Go to Post if you want to repay us for the omni-wheels, use the money to help out a few rookie teams next year. Buy them batteries or help build them bumpers, anything you see fit will be much better than cash back to us. - AllenGregoryIV [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-17-2003, 12:32 PM
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
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>>
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"

Last edited by Raven_Writer : 08-17-2003 at 12:36 PM.
  #2   Spotlight this post!  
Unread 08-18-2003, 12:18 PM
Greg Ross's Avatar
Greg Ross Greg Ross is offline
Grammar Curmudgeon
AKA: gwross
FRC #0330 (Beach 'Bots)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 2,245
Greg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond reputeGreg Ross has a reputation beyond repute
Send a message via AIM to Greg Ross Send a message via Yahoo to Greg Ross
You're talking about the editor you're writing, right? My guess is that you're sending the wrong buffer length to the tokenizer.
__________________
Greg Ross (The Grammar Curmudgeon formerly known as gwross)
S/W Engineer, Team 330, the Beach 'Bots
<--The Grammar Curmudgeon loves this cartoon.
ôLife should not be a journey to the grave with the intention of arriving safely in a pretty and well preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming "Wow! What a Ride!" Hunter S. Thompson
"Playing a practical joke means doing something mean and calling it funny." Me
  #3   Spotlight this post!  
Unread 08-18-2003, 12:33 PM
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Quote:
Originally posted by gwross
You're talking about the editor you're writing, right? My guess is that you're sending the wrong buffer length to the tokenizer.
Yes, I am

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;
}
char *szBuffer = new char[66356]; <-- 66356 is max amount of text that the TModuleRec source buffer can hold

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>>
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"
  #4   Spotlight this post!  
Unread 08-19-2003, 10:46 PM
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Are you sure szBuffer contains the whole thing? Trying doing a

MessageBox(NULL, szBuffer, "Test", MB_OK);

and see what it spits out.
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #5   Spotlight this post!  
Unread 08-20-2003, 07:07 AM
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Quote:
Originally posted by rbayer
Are you sure szBuffer contains the whole thing? Trying doing a

MessageBox(NULL, szBuffer, "Test", MB_OK);

and see what it spits out.
Sadly, it doesn't << cries >>.

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
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"

Last edited by Raven_Writer : 08-20-2003 at 07:51 AM.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PBASIC language syntax WizardOfAz Programming 14 04-30-2003 09:23 AM
Question Obtaining Pbasic 2.5 PyroPhin Programming 3 01-18-2003 12:26 AM
pbasic question Mike375 Programming 14 01-15-2003 05:54 AM
PBasic Question Melissa H. Programming 28 11-17-2002 05:53 PM
Another PBASIC Question Ian W. Programming 4 01-31-2002 08:36 PM


All times are GMT -5. The time now is 01:00 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi