Hot Topic (More than 10 Replies) Programming error (Read 2146 times)
Bejagee
Member
*
Offline


No personal text

Posts: 17
Joined: Dec 16th, 2003
Programming error
Mar 9th, 2004 at 3:22pm
Print Post Print Post  
I have been converting a rather large Q&A4 database to Sesame and I'm getting the following error:

ERROR WHILE PARSING MODULE “F0061 (1)”:
SYMBOL EXPECTED [ } ], SYMBOL FOUND [ ( ].
LINE 39, POSISTION 29: (
                                         GOTO @(4500 + X) };

Here is the part of the code where the error occurs:

IF F0061 <> "" THEN { X7 = 59; X8 = 199; GOSUB X9 };

IF F0061 <> "" THEN IF ORDERTYPE = "R"
                THEN { X = RNUM;
                       @(4600 + X) = @(4600 + X) + F0061;
                       TtlSHIP1 = @SUM(F0156,F0166,F0176,F0186,F0196,F0206,F0216,F0226,F0236,F0246,F0256,F0266);

IF TtlSHIP1=0 THEN TtlSHIP1="";

                       IF F0060 <> ""
                     THEN @(4500 + X) = F0060
                     ELSE @(4500 + X) = @DATE;
                      GOTO @(4500 + X) };
F0061 = "";

IF F0057 <> "DONE" THEN GOTO SCHEDULENEXT
                ELSE { @MSG("ORDER COMPLETE!");
                       DETAIL = "COMPLETE";
                       STATUS = "" };
GOTO EAORDERNUM



I not the original programmer of this database and don't have much experience in QABasic programming, so I'm not sure why its looking for a close bracket at that particular spot in the programming.  Any help would be appreciated.

Thanks!
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Programming error
Reply #1 - Mar 9th, 2004 at 4:32pm
Print Post Print Post  
I would recommend that you go through this and arrange the code properly. I have found this practices very important while writing and reading the codes. 

http://www.lantica.com/Support/sesamelibart26.html

Everything, especially "{" and "}" bracket error will become so obvious.  The error is suggesting that you need to place "}" before the line in question. If you paste the whole code from that event may be one can help you out.
  
Back to top
 
IP Logged
 
Bejagee
Member
*
Offline


No personal text

Posts: 17
Joined: Dec 16th, 2003
Re: Programming error
Reply #2 - Mar 9th, 2004 at 4:53pm
Print Post Print Post  
Here is the entire code:

TOTALSHIPPED = TOTALSHIPPED + F0061; IF TOTALSHIPPED = 0 THEN TOTALSHIPPED="";
BALANCETOSHIP = QTYTOBESHIPPED - TOTALSHIPPED; IF BALANCETOSHIP = 0 THEN BALANCETOSHIP="";
FINGDSINVENTORY = FINGDSINVENTORY - F0061; IF FINGDSINVENTORY = 0 THEN FINGDSINVENTORY="";
QTYSHIPPED = QTYSHIPPED + F0061; IF QTYSHIPPED = 0 THEN QTYSHIPPED="";

  IF F0061 <> ""
THEN { F0391 = F0383 + F0391; F0390 = F0382; if F0391 = 0 then F0391 = "";
      F0383 = F0375; F0382 = F0374; if F0383 = 0 then F0383 = "";
      F0375 = F0367; F0374 = F0366; if F0375 = 0 then F0375 = "";
      F0367 = F0359; F0366 = F0358; if F0367 = 0 then F0367 = "";
      F0359 = F0351; F0358 = F0350; if F0359 = 0 then F0359 = "";
      F0351 = F0349; F0350 = F0348; if F0351 = 0 then F0351 = "";
      F0349 = F0347; F0348 = F0346; if F0349 = 0 then F0349 = "";
      F0347 = F0339; F0346 = F0338; if F0347 = 0 then F0347 = "";
      F0339 = F0331; F0338 = F0330; if F0339 = 0 then F0339 = "";
      F0331 = F0323; F0330 = F0322; if F0331 = 0 then F0331 = "";
      F0323 = F0315; F0322 = F0314; if F0323 = 0 then F0323 = "";
      F0315 = F0307; F0314 = F0306; if F0315 = 0 then F0315 = "";
      F0307 = F0299; F0306 = F0298; if F0307 = 0 then F0307 = "";
      F0299 = F0291; F0298 = F0290; if F0299 = 0 then F0299 = "";
      F0291 = SQ01; F0290 = SHIPDATE01; if F0291 = 0 then F0291 = "";
      SQ01 = F0061;  SHIPDATE01 = F0060; if SHIPDATE01 = "" then SHIPDATE01 = @date;
      TOTALSHIPPED1 = @sum(SQ01,F0291,F0299,F0307,F0315,F0323,F0331,F0339,F0347,F0349,F0351,F0359,F036
7,F0375,F0383,F0391); if TOTALSHIPPED1 = 0 then TOTALSHIPPED1 = ""    };


IF F0061 <> "" THEN { X7 = 59; X8 = 199; GOSUB X9 };

IF F0061 <> "" THEN IF ORDERTYPE = "R"
                THEN { X = RNUM;
                       @(4600 + X) = @(4600 + X) + F0061;
                       TtlSHIP1 = @SUM(F0156,F0166,F0176,F0186,F0196,F0206,F0216,F0226,F0236,F0246,F0256,F0266);

IF TtlSHIP1=0 THEN TtlSHIP1="";

                       IF F0060 <> ""
                     THEN @(4500 + X) = F0060
                     ELSE @(4500 + X) = @DATE;
                     GOTO @(4500 + X) };
F0061 = "";

IF F0057 <> "DONE" THEN GOTO SCHEDULENEXT
                ELSE { @MSG("ORDER COMPLETE!");
                       DETAIL = "COMPLETE";
                       STATUS = "" };
GOTO EAORDERNUM

I'll try re-arranging the as you suggested.

Thanks for your help.



  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Programming error
Reply #3 - Mar 9th, 2004 at 4:55pm
Print Post Print Post  
This is what your programming looks like, there are needs for a couple of brackets that I can see....

IF F0061 <> "" THEN
     {
           X7 = 59;
           X8 = 199
           GOSUB X9
     }
 
IF F0061 <> "" THEN       //You need to have bracket here and one at the end I think


IF ORDERTYPE = "R"         THEN
    {
     X = RNUM; 
         @(4600 + X) = @(4600 + X) + F0061 
         TtlSHIP1 = @SUM(F0156,F0166,F0176,F0186,F0196,F0206,F0216,F0226,F0236,F0246,F0256,F 0266);

     IF TtlSHIP1 = 0 THEN
           TtlSHIP1 = ""
 
         IF F0060 <> ""  THEN
           @(4500 + X) = F0060 
         ELSE
           @(4500 + X) = @DATE
             GOTO @(4500 + X)
    } 

F0061 = ""
 
IF F0057 <> "DONE" THEN
     GOTO SCHEDULE          //needs to have brackets here too as two statements
     NEXT

ELSE
     {
           @MSG ("ORDER COMPLETE!")    
           DETAIL = "COMPLETE" 
               STATUS = ""
     } 

        
GOTO EAORDERNUM


Unfortunately, it does not look here as clear as it does in the notepad or programming window.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming error
Reply #4 - Mar 9th, 2004 at 5:06pm
Print Post Print Post  
Just as side note, this:
Quote:
GOTO @(4500 + X)

is not going to work in Sesame. You can't dynamically generate element references this way and use them in GoTo's.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bejagee
Member
*
Offline


No personal text

Posts: 17
Joined: Dec 16th, 2003
Re: Programming error
Reply #5 - Mar 9th, 2004 at 5:26pm
Print Post Print Post  
Is there an easy way to fix this?  As I mentioned, I didn't do the original programming and don't have a lot of experience with it.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming error
Reply #6 - Mar 9th, 2004 at 6:27pm
Print Post Print Post  
Quote:
Is there an easy way to fix this?  As I mentioned, I didn't do the original programming and don't have a lot of experience with it.


It depends on what this actually does. It's impossible to tell by looking at the code, which is the problem with techniques like this.  Control changes based on some unknown value entered in one of a list of fields. There's no way to tell what it is supposed to do without seeing your entire Q&A application and tracing it through.

Do you have any programming experience in any language?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bejagee
Member
*
Offline


No personal text

Posts: 17
Joined: Dec 16th, 2003
Re: Programming error
Reply #7 - Mar 9th, 2004 at 7:35pm
Print Post Print Post  
The only experience I have is with trying to figure my way through Q&A.  The original programmer is no longer with the company and he didn't leave any notes on what he did.  Will there be any programming/training classes available in Sesame?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming error
Reply #8 - Mar 9th, 2004 at 8:23pm
Print Post Print Post  
Quote:
The only experience I have is with trying to figure my way through Q&A.  The original programmer is no longer with the company and he didn't leave any notes on what he did.  Will there be any programming/training classes available in Sesame?


Basically, you need to use if...then constructs to decide where to jump. With a bit of redesign, much of this jumping around and @field stuff may become unnecessary.

If you want to try to work through this yourself, you can post specific questions here, as you encounter them and people will try to help. If you just want someone to do it for you, you might consider contacting and hiring a consultant.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bejagee
Member
*
Offline


No personal text

Posts: 17
Joined: Dec 16th, 2003
Re: Programming error
Reply #9 - Mar 9th, 2004 at 8:59pm
Print Post Print Post  
I'll see what I can do.  Thanks for your help.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: Programming error
Reply #10 - Mar 10th, 2004 at 4:15am
Print Post Print Post  
Bejagee,

Do not be afraid to try and learn Sesame.

Many of us on this forum are far from computer experts, but together we all try to learn and help each other out. I have found the people associated with this forum, both the Lanticans and users are incredible people. If someone asks for help and makes an effort to try to learn, someone is always willing to help.  Smiley

Remember everyone has to start somewhere I believe Sesame is the perfect place. Sesame offers the correct mix of powerful features, ease of use and a group of people with a commitment to putting out a quality product.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Bejagee
Member
*
Offline


No personal text

Posts: 17
Joined: Dec 16th, 2003
Re: Programming error
Reply #11 - Mar 10th, 2004 at 3:08pm
Print Post Print Post  
I've been impressed the quick responses you get from this forum.  I think Sesame will do the job for us once I get all the databases translated.  I'll be sure to post any other questions I have.

Thanks!
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Programming error
Reply #12 - Mar 10th, 2004 at 3:28pm
Print Post Print Post  
Just after a cursory look, it seems that your application is dealing with statement and invoicing kind of application and if it is so, you might do a far better with MainForm-Subform setup of Sesame. Sometimes it makes more sense to make something from scratch than translating as far as programming is concerned especially if you do not have a clue as to what previous programmer had done. Data can be transferred in either cases.  Just a thought.
  
Back to top
 
IP Logged