Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / ARG! Why won't this work!

Author
Message
Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 21st Aug 2003 22:17
In a previous post (A Problem With Data-Read and Arrays), Mentor, CattleRustler, and I pondered over why, when my program was run, that information from a Data command would be read into a User-Defined Type Array once, and once the program looped and restored a different data, would read absouloutly nothing. By the end of the post, we had decided that it had to do with me including a string amongst integers.

However, if you look at my code now, the string is included in a variable all of it's own now, and I am happy to report progress. Now, whenever the program loops, the string is printed each and every time. The integers are not. This narrows down the problem to the read,restore, or data commands. I ask for the simple information of whether or not what I'm doing with these commands is correct, and if it is, what I could do to correct this problem so I may continue in my programming.

Note: The sub in the program is used nowhere in the program. It is a failed attempt at fixing the current problem. I left it in to see if it sparked a thought as to what to do.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Aug 2003 22:42
insert this bit of code and the whole thing works fine (as in you can see it can read the data ok, the actual code doesn`t run yet but it reads and restores ok), either you can`t read data into types like that or there is an error with types and reading into them from data, OR there is an error in the punctuation that allows one to many objects to be read incorrectly or something, I am just going to try some mods of my own deviseing.

Mentor.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Aug 2003 23:07
stick this in and you get an error, "could not find field `MaxHP` in type MonsterPrimaryStats at line 219", I don`t see any error in my adaptation, any idea why that error crops up (on the compile), I think it may be a compiler error, the variable is there as far as I can see, maybe just use find and replace and stick in the variables I read instead may get it working, back in a while.

Mentor.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 21st Aug 2003 23:25 Edited at: 21st Aug 2003 23:26
just noticed that everthing in the read section is listed as monsterprimarystats, shouldn`t the lower half of them (from MaxHP onwards) be monsterappliedstats?, I tried changeing them (code below) it now runs but you still get zero in the variables, if I was you I would swap to basic variables, at least they work

Mentor.

Rwilson
21
Years of Service
User Offline
Joined: 19th May 2003
Location: United States
Posted: 22nd Aug 2003 01:43
At this rate, yeah I proboly will move to User Defined Typeless programming, But I'm sending a notice to tech support over this, maybe even post in the bug forum. Unless this is some form of limitation I've never heard of, this is definetly a bug, And one that should be fixed so people don't run into the same problem I am. Thanks for your help again, Mentor. Very, VERY much apprecaited.

Regards,
Ryan Wilson
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 22nd Aug 2003 17:23
it must be a bug, types are supposed to simplify programing and do all that normal variables can do as far as I know (if you can get your head round them ), and this definitley needs mentioning to the development team, I don`t see why they are zero the next time around though, you would expect them to be unchanged or garbage, not zero, most weird.

Mentor.
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 23rd Aug 2003 00:10 Edited at: 23rd Aug 2003 00:11
OK! this was realy annoying me, I spent the last hour on this and found out why it won`t work, it`s a bug!, you use a variable in a weird way to index the array and also indicate the monsters live/dead status, put a "MonNum=1" on line 142 and it works (apart from you also want to clear the screen between updates), go to the back of the class and miss supper, setting it to zero when you kill the monster set the index array to element 0, and that was uninitalised values, I was realy struggleing there, lol.

Mentor.

Login to post a reply

Server time is: 2024-09-20 19:41:51
Your offset time is: 2024-09-20 19:41:51