Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thank you again! I can't tell you how much I and my company appreciate what you've done! I love this place!..."

Geography

Where in the world do Tek-Tips members come from?
Reaper2050 (Programmer)
25 May 12 4:06
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

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!

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