Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sdlginput then run script 1 or 1 and 2

Status
Not open for further replies.

jamesjc

Technical User
Feb 21, 2006
6
CA
trying to make a script that when user enters a number depending on which it will open 1 or 2 scripts. Doesn't work right now it's some cut & paste from help file.

proc main
string name1
sdlginput "config" "enter 1 2 or 3" name1
transmit name1
transmit "^M"
integer name1
if name1 == 1
execute "1.wax"
endif
waitfor "done"
if name1 == 2
execute "1.wax"
endif
waitfor "done"
execute "2.wax"

endproc

thanks
 
forgot to ask at the same time,
-if receive "1" paste it in excel cell A1
-if receive "2" paste it in excel cell B1
 
You'll need to declare an integer value, say num1, at the beginning of your script. The change these two lines:

integer name1
if name1 == 1

to:

atoi name1 num1
if num1 == 1

as well as changing if name1 == 2 to if num1 == 2. The value retrieved in the sdlginput command is a string, so it needs to be converted to an integer using the atoi command before it can be checked.

 
Thanks knob

I was also wondering if it is possible to wait for text and paste that text to a cell in excel

let's say i receive
"1-Passed 5%"
"2-Passed 6%"

I want to paste 1 in cell A1 and 5% in B1
paste 2 in cell A2 and 6% in B2

I have seen a lot of post that were the other way around excel to procomm but not the above
 
Yep, that's possible, but you have to use RowColumn notation instead of A1, B1, etc. I have an example or two on the samples page of my site that should get you started.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top