PDA

View Full Version : Help...



Protocol
02-27-2004, 10:55 AM
I'm simply trying to read a text file to a table. I've written the code out...it all looks good. Then I go to build it and it thinks I need to add more "=" signs.

The line of code is (ProgramFiles is declared/referenced):

Times = TextFile.ReadToTable(ProgramFiles.."\\Project\\Text.txt");

Just out of curiosity, how many "=" signs should I have? Am I just smoking crack over here or is there something wrong? lol

Here's the build error with the embedded code:

==============================================

Starting build...
27-Feb-04 11:46:38 AM
Project file: D:\AutoPlay Media Studio Projects\Project.am5

Performing Pre-Build Checks...
Checking audio settings...
Checking scripts...

Syntax Error: [Location="Project:Loop", Event "On FSCommand", Line=7]
Error Detail: [`=' expected near `Times'] in [Times = TextFile.ReadToTable(ProgramFiles.."\\Project\\Text.txt");]
Checking project settings...
Checking object settings...

1 Errors, 0 Warnings
Build failed.

==============================================

Thanks again!


Protocol

Worm
02-27-2004, 11:10 AM
I can't tell what's going on. It looks correct to me, butmaybe there is a rogue line of code somewhere above it. Can you post more of a snippet?

Brett
02-27-2004, 11:14 AM
Can you provide more code so that I can see the context? It may be the line(s) before or after that code that is causing the problem.

rhosk
02-27-2004, 11:19 AM
Try -

Times = TextFile.ReadToTable( _ProgramFilesFolder.."\\Project\\Text.txt");

Edit -
The line of code is (ProgramFiles is declared/referenced): Didn't catch that, sorry.

Protocol
02-27-2004, 11:45 AM
No problem,

Here's the entire sequence:


==============================================

if (e_FSCommand == "Execute") then
LoopNumber = 1;
while (LoopNumber < 7) do
CurrentDate = System.GetDate(DATE_FMT_US);
CurrentTime = System.GetTime(TIME_FMT_AMPM);
CurrentDateTime = CurrentDate.." - " CurrentTime
Times = TextFile.ReadToTable(ProgramFiles.."\\Reminder Notes\\Times.txt");
ReminderTime = Table.Remove(Times, LoopNumber);
if (CurrentTime == ReminderTime) then
ReminderNumber = TextFile.ReadToString(ProgramFiles.."\\Reminder Notes\\Reminder "..LoopNumber..".txt");
Paragraph.SetText("Paragraph", Reminder);
Window.Restore(Application.GetWndHandle());
Table.Insert(Times, LoopNumber, "X");
TextFile.WriteFromTable(ProgramFiles.."\\Reminder Notes\\Times.txt", Times, false);
TextFile.WriteFromTable(ProgramFiles.."\\Reminder Notes\\Reminder "..LoopNumber..".txt", "", false);
end
LoopNumber = LoopNumber + 1;
end
end

==============================================

I got this to work perfectly yesterday (until the back-up scenario).

This is the first time I've posted AMS5 code...it doesn't seem to be indenting it, but they're all indented properly of course.

Thanks again,

Protocol

TJ_Tigger
02-27-2004, 11:47 AM
It looks like it might be this line

CurrentDateTime = CurrentDate.." - " CurrentTime

should be

CurrentDateTime = CurrentDate.." - " .. CurrentTime

Worm
02-27-2004, 11:48 AM
CurrentDateTime = CurrentDate .." - " .. CurrentTime

rhosk
02-27-2004, 11:48 AM
Maybe the ";" after the line -

CurrentDateTime = CurrentDate.." - " CurrentTime

rhosk
02-27-2004, 11:49 AM
OK, now that we're all on the same [line] page, LOL!!

Protocol
02-27-2004, 11:58 AM
Doh!

You guys rock! Thanks for being my eyes.

*Banging head against proverbial wall* "...Must...remember...to check...code..."

lol

Protocol

TJ_Tigger
02-27-2004, 12:00 PM
That was funny. How many people can answer the same question at the same time.?