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!

Convert Code To Clarion 6 Help

Status
Not open for further replies.

Reaper2050

Programmer
May 25, 2012
12
Good Day,

Can someone help me convert the following to Clarion? Any help would be highly appreciated.

Thanks in advance.


getstatus:
locate 4,40:print" ";
open "com1:4800,e,8,1" as #1
print #1,chr$(240+unitnumber%); 'FX X=unit number
delay 0.01
print #1,chr$(16*curhose%); 'Y0 Y=hose number
delay 0.01
print #1,chr$(176); 'B0 End of command
delay 0.1 'Wait for reply
buff%=loc(1) 'Length of input buffer
if buff%=0 then 'NO REPLY (OPEN LOOP)
S%=14
close #1
return
end if
on error goto stayalive1
recstrg$=input$(buff%,#1)
if buff%=4 then ' Should be xmitted plus rec'd bytes
if mid$(recstrg$,2,1)=chr$(16*curhose%) then 'Check echo
select case right$(recstrg$,1)
case chr$(224) 'ERR
S%=0
locate 4,40:print "ERR";
case chr$(225) 'OFF
S%=1
locate 4,40:print "OFF";
case chr$(226) 'CALL
S%=2
locate 4,40:print "CALL";
case chr$(227) 'BUSY
S%=3
locate 4,40:print "BUSY";
case chr$(228) 'FIN
S%=4
locate 4,40:print "FIN";
case chr$(229) 'ALONE
S%=5
locate 4,40:print "LONE";
case chr$(230) 'LEAK
S%=6
locate 4,40:print "LEAK";
case chr$(231) 'PERR
S%=7
locate 4,40:print "PERR";
case chr$(232) 'AUND
S%=8
locate 4,40:print "AUND";
case else 'UNDEFINED
S%=15
locate 4,40:print "UNDEFINED";
end select
else 'ECHO INCORRECT
S%=13
end if
else
S%=12 'INCORRECT NUMBER OF CHARACTERS
end if
recover1:
close #1
return

stayalive1:
S%=11 'TRANSMISSION ERROR
resume recover1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top