INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Convert Code To Clarion 6 Help

Convert Code To Clarion 6 Help

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close