Using a Comma in an If Statement

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Using a Comma in an If Statement

Post by kpassaur » Fri Jul 13, 2007 11:11 am

What I am trying to do is display a Comma in a drop down list in a Dialog Box, which I can do. Then if a comma is selected from the drop down list I want to write the value "Comma" in an ini file. The difficulty is that the if statement uses commas, so it seems to think I want a blank line.

Any ideas on overcoming this, I am sure it is simple but it escapes me



Let>Comma=,

Dialog>Dialog2
Caption=Setup CSV Export
Width=498
Height=230
Top=CENTER
Left=CENTER
Max=0
Min=0
Close=1
Resize=0
Edit=jobname,11,72,121,%Jobnamebox%
Label=Name this Job,139,76,true
Edit=Profileselected,12,104,349,%selectedprofile%
Button=Browse to Profile,368,104,109,25,0
Button=Exit,248,142,75,25,2
Button=Continue,174,142,75,25,1
Image=C:\consolegrab\Images\setupcsvoutput.bmp,0,0,513,65
ComboBox=SeparaterChoicebox,220,72,41,%Comma%%CRLF%;%CRLF%:%CRLF%~
CheckBox=headerlinechoice,Include Header Line,336,74,137,False
Label=Separator ,267,76,true
Label=Copyright© eDocFile Inc. 2006-2007,162,176,true
FileBrowse=Browse to Profile,Profileselected,ini files (*.ini)|*.ini,open,C:\consolegrab\ProfileManager\
EndDialog>Dialog2


Show>Dialog2
Label>MainLoop
GetDialogAction>Dialog2,result
If>result=2,finish
If>result=1,Continue
Wait>0.5
Goto>MainLoop

Label>Continue
Let>job=%Dialog2.jobname%.ini
IfFileExists>C:\consolegrab\CreateCSVFile\%job%
DeleteFile>C:\consolegrab\CreateCSVFile\%job%
Endif
WriteLn>C:\consolegrab\CreateCSVFile\%job%,result,[Job Settings]
WriteLn>C:\consolegrab\CreateCSVFile\%job%,result,Profile to use=%Dialog2.Profileselected%
Let>Separator=%Dialog2.SeparaterChoicebox%
If>%Dialog2.SeparaterChoicebox%=,
Let>Separator=Comma
Endif
WriteLn>C:\consolegrab\CreateCSVFile\%job%,result,Separator to Use=%Separator%
WriteLn>C:\consolegrab\CreateCSVFile\%job%,result,Header Line=%Dialog2.headerlinechoice%

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jul 13, 2007 1:09 pm

Assuming that you want to send the word "Comma" change your If statement to this:

Code: Select all

If>%Dialog2.SeparaterChoicebox%=%comma%
Let>comma=
Let>VAREXPLICIT=1
Let>Separator=Comma
Let>VAREXPLICIT=0
Let>comma=,
Endif

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts