Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RunTextAsMacro: cannot create new item: text is too long
#1
I've tried this in several ways. My macro is way too long cause it has specific data that came from an excel spreadsheet. The editor only allows up to 32k chars but my macro has about 980k. So I subdivided it into about 35 files of <32k each and run it using RunFileAsMacro "C:\File2.txt"
RunFileAsMacro "C:\File3.txt" ... etc to File35.txt

The Problem is that it is running only File35.txt over and over again.

What should I do? Would it behave differently if I put one file after the onther in one line or do I need to flush the memory somehow? Apparently, all it remembers is the contents of the last RunFileAsAMacro file but not the others. Thanks in advanced.
#2
what are you trying to do with the data? are you trying to put it into the editor?

post your code so we can take a look.
#3
This is the code I am trying to use for data entry. As I said, I have about 35 files filled with these, three text entries that come from my excel listing, each textr entry is divided by a tab and followed by couple of hits of the function keys. I add the wait times so that I can get to see the screens as it runs, just for confidence purposes.
Macro is
RunFileAsMacro "c:\File1.txt"
RunFileAsMacro "c:\File2.txt" etc. up to File35.txt
but still all it runs is File35.txt. Cry
-------- These are the first lines of File1.txt -------------
spe 2000 ;;wait 2 seconds after each run
ifi("Session A - [24 x 80]") act "Session A - [24 x 80]"
key "AA" T "B80" T "ABC67890"
1
key F9
1
key F9
1
key "AA" T "B81" T "ABC12345"
1
key F9
1
key F9
1
... etc
#4
oh, i thought you were trying to put it into the QM editor.

lets see the code that is putting the file data into the editor, that is probably where the problem is.
#5
Code:
Copy      Help
wait 0 H RunTextAsFunction(_s.getfile("c:\File1.txt"))
wait 0 H RunTextAsFunction(_s.getfile("c:\File2.txt"))
wait 0 H RunTextAsFunction(_s.getfile("c:\File3.txt"))

But better would be to get data directly from Excel, or from csv file.
#6
Save the worksheet as tab-delimited text file "file1.txt" on desktop. This macro will get data from that file, and repeat for each line.

Code:
Copy      Help
str sf.getfile("$desktop$\file1.txt")
str s s1 s2 s3
foreach s sf
,tok s &s1 3 "[9]"
,key (s1) T (s2) T (s3)
,1
,key F9
,1
,key F9
,1
#7
What does the comma on the lines after the "foreach" do?
#8
Commas can be used instead of tabs. Tabs are used with if, for, foreach and some other (see Help). Here commas are used because tabs are not displayed. To paste this code in QM, you can use menu Edit -> Other formats -> Paste escaped.


Forum Jump:


Users browsing this thread: 1 Guest(s)