View previous topic :: View next topic |
Author |
Message |
mikeb
Joined: 18 Aug 2004 Posts: 36
|
Posted: Sun Jul 14, 2019 2:14 pm Post subject: ForFilesIn macro error |
|
|
I have a wscript calling a macro that is returning the following error from a ForFilesIn loop when it tries to process a file without Title2.
Quote: | NULL result for replaceable parameter |TITLE2| in FileSaveAs | .
Once I hit OK, the following box pops up.
Quote: | Negative acknowledgement received from server | .
I press ok here and still have to open DPLOT (which has been running the macro while hidden) to close the file in question. This will then allow the wscript calling this to continue.
I put ErrorMessages(0) in macro, but it only eliminated the "NULL result..." message. I still got the "negative acknowledgement..." response. I still have to open the hidden DPLOT and close the open .grf file to allow my wscript to continue.
Is there another way to trap this "NULL result" error in macro? |
|
Back to top |
|
|
mikeb
Joined: 18 Aug 2004 Posts: 36
|
Posted: Mon Jul 15, 2019 11:31 am Post subject: |
|
|
This is the macro I am using. I am using # as a separator character to make file name parsing easier in wscript.
The commented out FileSaveAs line doesn't give an error, but generates a bitmap with filename only - no title2 or xaxistitle.
Code: | 'ImageConvert
'When calling from command line use:
' evimage.exe /d "c:\default directory" /m ImageConvert /show 0
' This macro:
' 1) opens each file matching *.grf from default dir
' 2) Saves as bmp using filename with title2 and xaxislabel appended,
' 3) closes each file
'
ErrorMessages(0)
'Directory("C:\evscans")
ForFilesIn("*.grf")
VAR_A=Request("Title2")
VAR_B=Request("XAxisLabel")
VAR_C=Request("fname")
FileSaveAs("BMP Picture","VAR_C#|TITLE2|#VAR_B#.bmp")
' FileSaveAs("BMP Picture","VAR_C#VAR_A#VAR_B#.bmp")'This generates bitmap of name only - no title or xaxis label
FileClose()
NextFile
FileExit() |
|
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Tue Jul 16, 2019 10:16 am Post subject: |
|
|
Mike,
There's no way to circumvent the behavior once an error has occurred. And within the macro there's no way to branch if some condition isn't met, like
if len(VAR_A) > 0 then
' do your normal thing
else
' do something else
endif
So... sorry! _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
mikeb
Joined: 18 Aug 2004 Posts: 36
|
Posted: Tue Jul 16, 2019 11:00 am Post subject: |
|
|
Any idea why
Code: | FileSaveAs("BMP Picture","VAR_C#VAR_A#VAR_B#.bmp") |
doesn't appear to return values for VAR_A or VAR_B - only VAR_C? |
|
Back to top |
|
|
|