CompuServe Thread

#IF AmigaDos THEN FAILURE

2 messages in this thread
#45911From: Zeddock MillerFeb 28, 1995 2:24 PM
SomeOne PLeeze help. I have spent hours on this and can't get it right. The Commodore manuals just don't cut it! Thanx, Zeddock Below find 2 programs (scripts) The first has the problem encased with ************, and remarks. It has to do with the IF command in AmigaDos. The second was my attempt to understand what IF wanted to evaluate correctly. I have struck out on both. Please enlighten me. set echo on failat 21 stack 40000 hd0:system/rexxmast delete maps:#?.map delete maps:#?.trace delete maps:weather.txt ;cd data:scala/scripts/weather/progs echo 0 >$isitOK cd sys:rexxc ;failat 11 rx data:scala/scripts/weather/progs/tv-3weather.ap requestchoice "CONTINUE???" "Did the Download work correctly, and you want to continue?" "YES|NO" >$isitOK ;************************************************************************ ******* ;The above call sends a 0 or 1 to $isitOK. How can I do an IF statement below to ;QUIT this script if $isitOK = 0? ; ;Example… ;IF $isitOK EQ 0 then ; QUIT ; ENDIF ; ;I know this does not work… What am I doing wrong??? ; ; ;************************************************************************* ******* cd golded: golded delete maps:thetime.txt date TO maps:thetime.txt cd ADPRO: run ADPRO FASTMEMONLY BH fred/fred SHALLOW ;cd data:scala/scripts/weather/weathermaps ;lha a ram:maps.lha *.iff cd work:scala run infochannel data:scala/scripts/main.tmp +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++END 1st Script +++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ echo 2 >$try2 type $try2 if $try2 EQ 2 echo hi endif +++++++++++++++++++++++End 2nd Script I really need help. I just don't get it! Zeddock
#45944From: Christopher LapriseMar 2, 1995 4:44 AM
I don't think the AmigaDOS 'IF' command will work if you use the word 'then' with it (it doesn't need 'then', nor should you use it). Try just: IF $isitOK EQ 0 QUIT ENDIF Also, commands can't be separated on a single line with ';' like in ARexx. In AmigaDOS, everything after a semicolon is ignored. Put the commands on separate lines. Further, you seem to be redirecting I/O to the wrong place for an environment variable. Try this: REQUESTCHOICE >ENV:$isitOK "CONTINUE???" "Did the Download work correctly, and you want to continue?" "YES|NO" In other words, put the '>' right after the command (not an absolute rule, but this helps) and do _not_ omit the 'ENV:' from the redirection destination. You had these problems in other lines than just the one above. Hope this helps. -Chris