|
Post by Wayne Rayner on Apr 15, 2010 20:10:51 GMT -5
Hey guys, I believe that basic4GL doesn't know how to add. Well can someone help me with fixing the deduction of money. I started the company with $100000 and I have a function that takes the weekly wage off hired staff. But the problem is 1 employee is meant to cost $500 per week. instead it takes 5K off and after first week deduction it boosts you to $995000 which is not meant to do that. I hope someone can help me Wayne Rayner Attachments:
|
|
|
Post by Supermonkey on Apr 16, 2010 11:24:41 GMT -5
I tried finding the bug but all you've done is given me the entire program and I have better things to do than debug your code. I suspect it's not basic4gl at all and is actually a bug in your code which you should try to find yourself . [edit] If you'd used the debugger (it's very good I suggest you learn how to use it) you'd see basic4gl is calculating the value fine. I'm assuming when you write the new value to the screen you're getting "99500" output as well as the last "0" from the "100000" you wrote to the screen previously. I dunno why this is happening, I haven't used basic4gl for ages. Are you not clearing the screen when you should be? [edit2] Stick a cls after the Main label and it fixes it '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Main in Game menu Main: cls help = NewSprite (tex(2)) SprSetPos (100,500) SprSetSize (150,50) BindSprite (help)
hire = NewSprite (tex(3)) SprSetPos (400,200) SprSetSize (150,50) BindSprite (hire)
create = NewSprite (tex(4)) SprSetPos (600,300) SprSetSize (150,50) BindSPrite (create)
invent = NewSprite (tex(5)) SprSetPos (600,200) SprSetSize (150,50) BindSprite (invent)
marketing = NewSprite (tex(6)) SprSetPos (600,400) SprSetSize (150,50) BindSprite (marketing)
nextweek = NewSprite (tex(8)) SprSetPos (650,500) SprSetSize (150,50) BindSprite(nextweek)
locate 0,0: print name$ " $" playermoney locate 50,0: print companyname$ " $" companymoney locate 30,0: print "Week " week
|
|