943,923 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3446
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Feb 27th, 2006
0

Re: Script problem help

Hmmmmm....that didnt fix it either.. Fatal errors are by far the most annoying to debug >_<"
Reputation Points: 10
Solved Threads: 0
Light Poster
Mike182 is offline Offline
34 posts
since Jul 2005
Feb 27th, 2006
0

Re: Script problem help

like I said before, you wil be spinning your wheels because you are attempting to compile a program that isn't c or c++. you might also make macros out of those funny-looking variable names to redefine then according to c and c++ rules.

C++ Syntax (Toggle Plain Text)
  1. #ifndef function

do you have a matching #endif for that???
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Feb 27th, 2006
0

Re: Script problem help

Macros eh? Hmmm, how can I redefine them to C/C++ rules?
Thanks alot for your help so far, I appreciate it.
EDIT:
I didnt have an #endif, but when I placed one in it created 62 errors =\
EDIT 2: The 62 errors came from an #endif in the script file, it still has 1 error if i put the #endif function in.
Reputation Points: 10
Solved Threads: 0
Light Poster
Mike182 is offline Offline
34 posts
since Jul 2005
Feb 27th, 2006
0

Re: Script problem help

I just tried it -- macors won't work either because the compiler doesn't like the '@' character. You will have to resort to brute force and manually make all the changes. For example, change $@db_count to db_count. you also will have to declare the data types because c will not let you use a variable before it is defined, line vb will do.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Feb 27th, 2006
0

Re: Script problem help

What do you mean 'line vb will do'?
Ok, Ive removed all the $ and @, and still have the error, what is it I have to define?
Reputation Points: 10
Solved Threads: 0
Light Poster
Mike182 is offline Offline
34 posts
since Jul 2005
Feb 27th, 2006
0

Re: Script problem help

<<'line vb will do'

typo -- replace "line" with "like".

You do know how to write c/c++ programs don't you?

I don't think it will be very easy to port that code. What are you trying to do anyway? Why port it at all? there is a huge amount of code examples to follow if you want to access a database in c or c++. There are even some c++ classes on the net.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Feb 27th, 2006
0

Re: Script problem help

Its not really for porting, I just needed to find and fix the errors in it, thats all it was for. The last is proving to be remarkably difficult to solve.. And yes, I do know how to write c/c++ programs, Im just not an elite at it.
Reputation Points: 10
Solved Threads: 0
Light Poster
Mike182 is offline Offline
34 posts
since Jul 2005
Feb 27th, 2006
0

Re: Script problem help

C++ Syntax (Toggle Plain Text)
  1. set $@array_size, getarraysize(getarg(0));

That is neither a standard C or C++ statement. You will have to find out what language it was written in, then learn what it does. my guess is that it is assigning the return value of function getarraysize() to variable $@array_size
C++ Syntax (Toggle Plain Text)
  1. int array_size = getarraysize(getarg(0));

now I have no clue what getarg(0) will return. you will need to find that out too.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Feb 27th, 2006
0

Re: Script problem help

All that stuff like OnInit, db_count and such is all already defined in the RO source code, its C++ but its been defined in another file, the file I posted just has some general debug errors, 2 of which I fixed. I looked up the fatal error C1004 on the msdn homepage, but it doesnt look to be much help.
Reputation Points: 10
Solved Threads: 0
Light Poster
Mike182 is offline Offline
34 posts
since Jul 2005
Feb 27th, 2006
0

Re: Script problem help

Quote originally posted by Mike182 ...
its C++ .
No it is NOT c++. The code you posed is probably run through another language's preprocessor which translates it into c++ code. You cannot compile that code directly with a c++ compiler. It must be interpreted by anothr preprocessor first.

Many database 4GL programs are like that. The code is similar to c an c++, but isn't.

>>C1004
you can get that error several ways. mismatches braces, brackets #ifdef/#endif are a few. It can be a real bear sometimes to find the error. One of my debugging solutions to find it is to start commenting out large blocks of code until I find the problem.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Print Max Prime Number???
Next Thread in C++ Forum Timeline: assignment operator for a 3d array





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC