I have a text file, in this file I want to put some code.
Sample code (not the code in the text file):
- Code: Select all Expand view RUN
#include "FiveWin.ch"
Function Main()
LOCAL cText:=MemoRead("myfile.txt")
&cText
Return Nil
The above works if the text file has:
- Code: Select all Expand view RUN
- MsgInfo('Hello World')
If I change the text file to have:
- Code: Select all Expand view RUN
- IIF( EMPTY(cText), MsgInfo('cText is empty'), MsgInfo('cText is NOT empty') )
It also works.
Now, if I have the following in my text file it does not work (generates an error: Syntax Error &):
- Code: Select all Expand view RUN
- IF EMPTY('cText')
MsgInfo('cText is empty')
ELSE
MsgInfo('cText is NOT empty')
ENDIF
Any ideas?
It's not easy to explain why I want to do this but I will give it a shot...
I am importing data from many different medical systems.
I have a config file that let's me setup start/end points to grab data, something like:
<STARTDATE>10/10/2017</STARTDATE>
<STARTTIME>11:49AM</STARTTIME>
Some systems will have the data a little different:
<STARTDATE>10/10/2017 11:49AM</STARTDATE>
So both date and time are in the same segment.
So I was thinking, in my config file I could have a memo field for each item that would allow me to have code so I can strip out the date and the time if they are in the same segment.
This is a very basic example but I hope it gives the right idea as to what I'm trying to do.
I'm trying to stay away from hard coding some of this so it will be easy to add more systems that I can import from.