• Support
  • Articles
  • Resources
  • Products

convert a filereadln into value to be used as a comport

Moderator: boris

2 postsPage 1 of 1

keithb
Newbie

Posts:
4
Joined: Wed Feb 07, 2018 2:13 pm
by keithb » Tue Feb 13, 2018 3:03 pm
Hello,

Im trying to read a line from a file and convert the line that was read into a value that be be linked to a comport.
so far i can read the line and display it into a message box so i know the value but i cant turn that into a comport.

Code: Select all

  1. ;
  2. Read a line from the file.
  3. filereadln fhandle line
  4. ; Display the line.
  5. messagebox line 'Number of Arm port'
  6. ; Repeat until the end of the file.
  7.  
  8. Arm = line
  9.  
  10. fileclose fhandle
  11. connect '/C=Arm'
  12. end
  13.  


I need a way of converting the LINE VALUE to a Text that can be read by the connect command.

Thank you for reading my comment. hopefully you can help me.
Thank you!
Keith
keithb
Newbie

Posts:
4
Joined: Wed Feb 07, 2018 2:13 pm
by keithb » Tue Feb 13, 2018 3:37 pm
i think i have solved this by:

Code: Select all

  1.  
  2. fileopen fhandle 'C:\Users\keithb\ARMCOM.log' 0
  3. filereadln fhandle line
  4. ; Display the line.
  5. messagebox line 'Number of Arm port'
  6. ; Repeat until the end of the file.
  7. fileclose fhandle
  8. inputstr = line
  9. constr = '/C='
  10. strconcat constr line
  11. strconcat constr ' /BAUD=115200'
  12. connect constr
  13.  
  14. setecho 1
  15.  
  16. yesnobox 'Has it connected?' 'Connection?'
  17.  
Thank you!
Keith
Display posts from previous:
Sort by:

2 postsPage 1 of 1

Users browsing this forum: No registered users
cron