|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
PBASIC Syntax Question
I'm not sure why this happening, but in my PBASIC editor, whenever I try to download the code (for testing), it always returns an error "201 - Expecting '}'", and here's the only thing I have in the code:
'{$STAMP BS2} Even when I use the default code given, it still returns this error. Anyone have an idea why this is happening? <<EDIT>>: If I use the code from RoboEmu (File -> Write Code) in my program, it gives this error, but in the Parallax one it is perfect :<</EDIT>> Last edited by Raven_Writer : 17-08-2003 at 13:36. |
|
#2
|
|||||
|
|||||
|
You're talking about the editor you're writing, right? My guess is that you're sending the wrong buffer length to the tokenizer.
|
|
#3
|
|||||
|
|||||
|
Quote:
![]() I don't know if this will help, but here is the code I use to tokenize the code: Code:
void CMainFrame::OnDlcode()
{
CMainFrame *pFrame = (CMainFrame*) AfxGetMainWnd(); // Get frame window class
CFIRSTEditorView *pView = (CFIRSTEditorView*) pFrame->GetActiveView();
char *szBuffer = new char[66356];
// Use if below fails to do memory right: char *szBuffer = new char[pView->GetWindowTextLength()]; // New 'char' pointer array based on window text length
pView->GetWindowText(szBuffer, pView->GetWindowTextLength()); // Get view window text
tModRec.SourceSize = strlen(szBuffer);
Compile(&tModRec, szBuffer, false, true);
if(tModRec.Succeeded == true){
StatusBarMessage("Tokenize successful!"); // Tell the user it went smoothly
}
else{
StatusBarMessage(tModRec.Error);
}
delete [] szBuffer;
}
pView->GetWindowText(szBuffer, pView->GetWindowTextLength()); // Get view window text <-- For some reason, I got a feeling it has to deal w/ this, or the szBuffer part. This is in MFC also. <<EDIT>>: I forgot to say that I was using the wrong way to do the STAMP, it's ' {$STAMP BS2p}, not ' {$STAMP S2p} :<</EDIT>> |
|
#4
|
||||||
|
||||||
|
Are you sure szBuffer contains the whole thing? Trying doing a
MessageBox(NULL, szBuffer, "Test", MB_OK); and see what it spits out. |
|
#5
|
|||||
|
|||||
|
Quote:
Thanks for the help on that (should've known to do a test on that). Now to figure out why (which I have an idea). << EDIT >>: I found out why...it was because of the SETSEL LPARAM section was probably to small, and plus I needed a space after the '}' in my code for it to register it (argh!) << EDIT 2 >>: I can get it compile or whatever way you think of it (tokenize). Now, does anyone have a thing on making a progress bar move? (Sorry, MSDN is really buggin' me right now). If you wanna know, I used to get the 157 error. But I had to set the first compile boolean to true in order to tokenize successfully. Thanks for all your help people ![]() Last edited by Raven_Writer : 20-08-2003 at 08:51. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PBASIC language syntax | WizardOfAz | Programming | 14 | 30-04-2003 10:23 |
| Question Obtaining Pbasic 2.5 | PyroPhin | Programming | 3 | 18-01-2003 01:26 |
| pbasic question | Mike375 | Programming | 14 | 15-01-2003 06:54 |
| PBasic Question | Melissa H. | Programming | 28 | 17-11-2002 18:53 |
| Another PBASIC Question | Ian W. | Programming | 4 | 31-01-2002 21:36 |