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.

DarkBASIC Professional Discussion / y = y - 4 reads as y4??? confusing syntax error.

Author
Message
0motnahp0
14
Years of Service
User Offline
Joined: 11th Apr 2012
Location:
Posted: 13th Apr 2012 20:57
I'm new.

heres my code



heres my error:

could not determine perameter type of 'y4' at line 19.

line 19 refers to the code: y = y – 4

if I erase that line, it does the same thing for each of the other 3 directions.

any ideas how to make the code work? tried on 2 computers

It is a profitable thing if one is wise, to seem foolish.
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 13th Apr 2012 23:26
not sure whats the problem is, but you always can u se Inc and Dec functions to increase and decrease your numbers
x = x+4
same as:
inc(x,4)

or
y = y - 4
same as:
dec(y,4)

replace those and try again.

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Apr 2012 23:27
Cool typo you have there

Basically, where you have:
y = y – 4

you should have:
y = y - 4

Although it's not obvious from the font in use here, the first minus sign (the one that you use) isn't actually a minus sign - it's a dash.

If you are using the new/standard editor with the default colour scheme, you can see that your minus sign is in black, while mine would be in red (same colour as the numbers) and is slightly shorter.

Here's your corrected code:


Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Apr 2012 23:32 Edited at: 13th Apr 2012 23:34
It's because you've used a character that isn't a minus sign. The following code, which superficially looks like yours, compiles fine:



I've no idea which character you managed to type there - or how.

Edit Posted too late again - serves me right for watching TV at the same time.
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Apr 2012 23:45
Usually cause by copy/paste from a word processor like Word or LibreOffice/OpenOffice, which 'auto-correct' a minus into a dash when it's surrounded by spaces.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 13th Apr 2012 23:50
Ah! Should have thought of that. I used to have that problem a lot trying to type maths formulae in text in Word. (Yes I know there are better ways. )

Login to post a reply

Server time is: 2026-07-09 02:12:42
Your offset time is: 2026-07-09 02:12:42