Jump to content



0

Illegal Character Error in DASM


12 replies to this topic

#1 jman1093 OFFLINE  

jman1093

    Space Invader

  • 11 posts

Posted Fri Oct 24, 2008 5:56 PM

Whenever I try to compile my game, 2600basic runs fine and generates a .asm file, but when DASM starts, I get the following error:
2600 Basic compilation complete.
DASM V2.20.07, Macro Assembler ©1988-2003
2600basic_variable_redefs.h (2): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (3): error: Illegal character '{5}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (3): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (3): error: Syntax Error 'z{5}'.
2600basic_variable_redefs.h (4): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (5): error: Illegal character '{4}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (5): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (5): error: Syntax Error 'z{4}'.
2600basic_variable_redefs.h (6): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (7): error: Illegal character '{7}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (7): error: Illegal character '}'.
char = '}' 125 (-1: 55)
2600basic_variable_redefs.h (7): error: Syntax Error 'w{7}'.
2600basic_variable_redefs.h (8): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (9): error: Illegal character '{6}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (9): error: Illegal character '}'.
char = '}' 125 (-1: 54)
2600basic_variable_redefs.h (9): error: Syntax Error 'w{6}'.
2600basic_variable_redefs.h (10): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (11): error: Illegal character '{5}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (11): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (11): error: Syntax Error 'w{5}'.
2600basic_variable_redefs.h (12): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (13): error: Illegal character '{4}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (13): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (13): error: Syntax Error 'w{4}'.
2600basic_variable_redefs.h (14): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (15): error: Illegal character '{3}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (15): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (15): error: Syntax Error 'w{3}'.
2600basic_variable_redefs.h (16): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (17): error: Illegal character '{2}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (17): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (17): error: Syntax Error 'w{2}'.
2600basic_variable_redefs.h (18): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (19): error: Illegal character '{1}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (19): error: Illegal character '}'.
char = '}' 125 (-1: 49)
2600basic_variable_redefs.h (19): error: Syntax Error 'w{1}'.
2600basic_variable_redefs.h (20): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (21): error: Illegal character '{0}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (21): error: Illegal character '}'.
char = '}' 125 (-1: 48)
2600basic_variable_redefs.h (21): error: Syntax Error 'w{0}'.
2600basic_variable_redefs.h (22): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (23): error: Illegal character '{3}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (23): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (23): error: Syntax Error 'z{3}'.
2600basic_variable_redefs.h (24): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (25): error: Illegal character '{2}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (25): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (25): error: Syntax Error 'z{2}'.
2600basic_variable_redefs.h (2): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (3): error: Illegal character '{5}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (3): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (3): error: Syntax Error 'z{5}'.
2600basic_variable_redefs.h (4): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (5): error: Illegal character '{4}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (5): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (5): error: Syntax Error 'z{4}'.
2600basic_variable_redefs.h (6): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (7): error: Illegal character '{7}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (7): error: Illegal character '}'.
char = '}' 125 (-1: 55)
2600basic_variable_redefs.h (7): error: Syntax Error 'w{7}'.
2600basic_variable_redefs.h (8): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (9): error: Illegal character '{6}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (9): error: Illegal character '}'.
char = '}' 125 (-1: 54)
2600basic_variable_redefs.h (9): error: Syntax Error 'w{6}'.
2600basic_variable_redefs.h (10): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (11): error: Illegal character '{5}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (11): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (11): error: Syntax Error 'w{5}'.
2600basic_variable_redefs.h (12): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (13): error: Illegal character '{4}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (13): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (13): error: Syntax Error 'w{4}'.
2600basic_variable_redefs.h (14): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (15): error: Illegal character '{3}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (15): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (15): error: Syntax Error 'w{3}'.
2600basic_variable_redefs.h (16): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (17): error: Illegal character '{2}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (17): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (17): error: Syntax Error 'w{2}'.
2600basic_variable_redefs.h (18): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (19): error: Illegal character '{1}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (19): error: Illegal character '}'.
char = '}' 125 (-1: 49)
2600basic_variable_redefs.h (19): error: Syntax Error 'w{1}'.
2600basic_variable_redefs.h (20): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (21): error: Illegal character '{0}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (21): error: Illegal character '}'.
char = '}' 125 (-1: 48)
2600basic_variable_redefs.h (21): error: Syntax Error 'w{0}'.
2600basic_variable_redefs.h (22): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (23): error: Illegal character '{3}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (23): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (23): error: Syntax Error 'z{3}'.
2600basic_variable_redefs.h (24): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (25): error: Illegal character '{2}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (25): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (25): error: Syntax Error 'z{2}'.
      bytes of ROM space left
Unrecoverable error(s) in pass, aborting assembly!

Being new to Batari, I have no idea what the heck any of that means. :?:

Thanks for the help.

#2 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Oct 24, 2008 6:21 PM

Only big brains know what that stuff means, but if you post your code, those of us with tiny brains might be able to see the problem.

#3 Robert M OFFLINE  

Robert M

    Stargunner

  • 1,481 posts
  • Rootbeer!
  • Location:Western NY state

Posted Fri Oct 24, 2008 6:35 PM

You really need to post the source code, or it nearly impossible to help. ;)

#4 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Fri Oct 24, 2008 11:51 PM

View Postjman1093, on Fri Oct 24, 2008 6:56 PM, said:

Whenever I try to compile my game, 2600basic runs fine and generates a .asm file, but when DASM starts, I get the following error:
2600 Basic compilation complete.
DASM V2.20.07, Macro Assembler ©1988-2003
2600basic_variable_redefs.h (2): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (3): error: Illegal character '{5}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (3): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (3): error: Syntax Error 'z{5}'.
2600basic_variable_redefs.h (4): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (5): error: Illegal character '{4}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (5): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (5): error: Syntax Error 'z{4}'.
2600basic_variable_redefs.h (6): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (7): error: Illegal character '{7}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (7): error: Illegal character '}'.
char = '}' 125 (-1: 55)
2600basic_variable_redefs.h (7): error: Syntax Error 'w{7}'.
2600basic_variable_redefs.h (8): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (9): error: Illegal character '{6}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (9): error: Illegal character '}'.
char = '}' 125 (-1: 54)
2600basic_variable_redefs.h (9): error: Syntax Error 'w{6}'.
2600basic_variable_redefs.h (10): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (11): error: Illegal character '{5}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (11): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (11): error: Syntax Error 'w{5}'.
2600basic_variable_redefs.h (12): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (13): error: Illegal character '{4}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (13): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (13): error: Syntax Error 'w{4}'.
2600basic_variable_redefs.h (14): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (15): error: Illegal character '{3}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (15): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (15): error: Syntax Error 'w{3}'.
2600basic_variable_redefs.h (16): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (17): error: Illegal character '{2}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (17): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (17): error: Syntax Error 'w{2}'.
2600basic_variable_redefs.h (18): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (19): error: Illegal character '{1}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (19): error: Illegal character '}'.
char = '}' 125 (-1: 49)
2600basic_variable_redefs.h (19): error: Syntax Error 'w{1}'.
2600basic_variable_redefs.h (20): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (21): error: Illegal character '{0}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (21): error: Illegal character '}'.
char = '}' 125 (-1: 48)
2600basic_variable_redefs.h (21): error: Syntax Error 'w{0}'.
2600basic_variable_redefs.h (22): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (23): error: Illegal character '{3}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (23): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (23): error: Syntax Error 'z{3}'.
2600basic_variable_redefs.h (24): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (25): error: Illegal character '{2}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (25): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (25): error: Syntax Error 'z{2}'.
2600basic_variable_redefs.h (2): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (3): error: Illegal character '{5}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (3): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (3): error: Syntax Error 'z{5}'.
2600basic_variable_redefs.h (4): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (5): error: Illegal character '{4}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (5): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (5): error: Syntax Error 'z{4}'.
2600basic_variable_redefs.h (6): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (7): error: Illegal character '{7}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (7): error: Illegal character '}'.
char = '}' 125 (-1: 55)
2600basic_variable_redefs.h (7): error: Syntax Error 'w{7}'.
2600basic_variable_redefs.h (8): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (9): error: Illegal character '{6}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (9): error: Illegal character '}'.
char = '}' 125 (-1: 54)
2600basic_variable_redefs.h (9): error: Syntax Error 'w{6}'.
2600basic_variable_redefs.h (10): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (11): error: Illegal character '{5}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (11): error: Illegal character '}'.
char = '}' 125 (-1: 53)
2600basic_variable_redefs.h (11): error: Syntax Error 'w{5}'.
2600basic_variable_redefs.h (12): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (13): error: Illegal character '{4}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (13): error: Illegal character '}'.
char = '}' 125 (-1: 52)
2600basic_variable_redefs.h (13): error: Syntax Error 'w{4}'.
2600basic_variable_redefs.h (14): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (15): error: Illegal character '{3}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (15): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (15): error: Syntax Error 'w{3}'.
2600basic_variable_redefs.h (16): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (17): error: Illegal character '{2}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (17): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (17): error: Syntax Error 'w{2}'.
2600basic_variable_redefs.h (18): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (19): error: Illegal character '{1}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (19): error: Illegal character '}'.
char = '}' 125 (-1: 49)
2600basic_variable_redefs.h (19): error: Syntax Error 'w{1}'.
2600basic_variable_redefs.h (20): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (21): error: Illegal character '{0}'.
char = '{' 123 (-1: 119)
2600basic_variable_redefs.h (21): error: Illegal character '}'.
char = '}' 125 (-1: 48)
2600basic_variable_redefs.h (21): error: Syntax Error 'w{0}'.
2600basic_variable_redefs.h (22): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (23): error: Illegal character '{3}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (23): error: Illegal character '}'.
char = '}' 125 (-1: 51)
2600basic_variable_redefs.h (23): error: Syntax Error 'z{3}'.
2600basic_variable_redefs.h (24): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (25): error: Illegal character '{2}'.
char = '{' 123 (-1: 122)
2600basic_variable_redefs.h (25): error: Illegal character '}'.
char = '}' 125 (-1: 50)
2600basic_variable_redefs.h (25): error: Syntax Error 'z{2}'.
      bytes of ROM space left
Unrecoverable error(s) in pass, aborting assembly!

Being new to Batari, I have no idea what the heck any of that means. :?:

Thanks for the help.
The 2600basic_variable_redefs.h file contains a list of the variable redefinitions from the dim statements. For example, if you write a batari Basic that contains nothing but the following line, and then compile it, the 2600basic_variable_redefs.h file's contents will be as follows:

   dim my_variable = a
2600basic_variable_redefs.h file contents:

; This file contains variable mapping and other information for the current project.

my_variable = a
The error messages you're getting contain references to things like "z{4}"-- and that's the way you would refer to a bit of one of the variables, so I'm guessing you're trying to dim your own variables to single bits, such as the following:

   dim my_bit_variable = a{1}
2600basic_variable_redefs.h file contents:

; This file contains variable mapping and other information for the current project.

my_bit_variable = a{1}
Compiler errors:

---------- Capture Output ----------
> "C:\Atari2600\bB\2600bas.bat" "C:\Atari2600\bB\Projects\test_dim.bas"
2600 Basic compilation complete.
DASM V2.20.07, Macro Assembler (C)1988-2003
2600basic_variable_redefs.h (2): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (3): error: Illegal character '{1}'.
char = '{' 123 (-1: 97)
2600basic_variable_redefs.h (3): error: Illegal character '}'.
char = '}' 125 (-1: 49)
2600basic_variable_redefs.h (3): error: Syntax Error 'a{1}'.
2600basic_variable_redefs.h (2): error: Not enough args passed to Macro.
2600basic_variable_redefs.h (3): error: Illegal character '{1}'.
char = '{' 123 (-1: 97)
2600basic_variable_redefs.h (3): error: Illegal character '}'.
char = '}' 125 (-1: 49)
2600basic_variable_redefs.h (3): error: Syntax Error 'a{1}'.
	  bytes of ROM space left
Unrecoverable error(s) in pass, aborting assembly!
Complete.

> Terminated with exit code 0.
You can't dim your own variables to single bits like that. Instead, you'll need to dim a whole variable, and then you can refer to the individual bits you're interested in, as follows:

   dim my_variable = a
   my_variable{0} = 0
   my_variable{1} = 0
   my_variable{2} = 1
   my_variable{3} = 0
   my_variable{4} = 0
   my_variable{5} = 0
   my_variable{6} = 0
   my_variable{7} = 0
   rem * That should set my_variable to 4, or %00000100.
   score = 0
   if my_variable > 0 then for temp1 = 1 to my_variable : score = score + 1 : next
   scorecolor = $0E : rem * white
loop_1
   drawscreen
   if joy0fire then exit_loop_1
   goto loop_1
exit_loop_1
   rem * The score will display "000004".
   rem * Obviously, it would be easier to just use binary values:
   my_variable = %10101010
   rem * That should set my_variable to 170.
   score = 0
   if my_variable > 0 then for temp1 = 1 to my_variable : score = score + 1 : next
   if !my_variable{4} then COLUBK = $44 : rem * red
   if !my_variable{5} then scorecolor = $1C : rem * yellow
loop_2
   drawscreen
   goto loop_2
   rem * The screen will be red with a white score of "000170",
   rem * because my_variable{4} is 0, so !my_variable{4} is true;
   rem * and my_variable{5} is 1, so !my_variable{5} is false.
Michael

#5 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Oct 25, 2008 12:59 AM

To help future bB users who might have a similar problem, I added part of your example to the bB page:

http://www.randomter...mmands.html#bit

#6 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sat Oct 25, 2008 1:28 AM

View PostRandom Terrain, on Sat Oct 25, 2008 2:59 AM, said:

To help future bB users who might have a similar problem, I added part of your example to the bB page:

http://www.randomter...mmands.html#bit
Actually, my example wasn't very good, because we'd probably want to use different names for the different bits. So we could do something like the following:

   dim level = a
   rem * level will use only bits 0-3, so its value will be 0 to 15

   dim sparelives = a
   rem * sparelives will use only bits 4-6, so its value will be 0 to 7

   dim gameover = a
   rem * gameover will use only bit 7, so its value will be 0 or 1

   level = level && %11110000 : rem * set level to 0
   rem * this clears bits 0-3 without affecting bits 4-7

   sparelives = sparelives && %10001111 || %00100000 : rem * set sparelives to 2
   rem * this clears bits 4-6 without affecting bits 0-3 and bit 7, then it sets bit 5

   gameover{7} = 0 : rem * set gameover to 0 (no, or false)
   rem * this clears bit 7 without affecting bits 0-6
Setting or clearing a single bit is easy (as with gameover in the example), but setting or clearing a group of bits at once without affecting the other bits in the byte will require using AND (&&) and OR (||).

Michael

#7 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Oct 25, 2008 1:43 AM

View PostSeaGtGruff, on Sat Oct 25, 2008 2:28 AM, said:

Actually, my example wasn't very good, because we'd probably want to use different names for the different bits. So we could do something like the following . . .
If you get a chance, could you create a new thread with that example and a bit of info on this subject and I'll say that they should visit your thread for more information?

Speaking of your example, shouldn't "level && %11110000" be "level & %11110000"?


Thanks.

#8 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Sat Oct 25, 2008 2:14 AM

View PostRandom Terrain, on Sat Oct 25, 2008 2:43 AM, said:

Speaking of your example, shouldn't "level && %11110000" be "level & %11110000"?
Could be. I tend to get & and &&, and | and ||, confused. Also, I think batari once said that & and | will work in all cases-- logical operations as well as bit operations-- so it's probably safest to just use & and | all the time, anyway (but I'm not sure about that).

Michael

#9 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Sat Oct 25, 2008 10:42 AM

I thought I'd mention that what the OP is trying to do is possible, though in a slightly different way, with builds after about April '07. I don't remember if I posted anything newer than that, but if I did, you can use "def" to redefine a bit definition as something more useful. You would do something like "def GAMEFLAG = a{1}" or something. If no suitable build exists, maybe it's about time to post one.

EDIT: Alright, here's a build of just the exe files. Use at your own risk.

Attached Files


Edited by batari, Sat Oct 25, 2008 11:03 AM.


#10 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Oct 25, 2008 11:49 AM

View Postbatari, on Sat Oct 25, 2008 12:42 PM, said:

I thought I'd mention that what the OP is trying to do is possible, though in a slightly different way, with builds after about April '07. I don't remember if I posted anything newer than that, but if I did, you can use "def" to redefine a bit definition as something more useful. You would do something like "def GAMEFLAG = a{1}" or something. If no suitable build exists, maybe it's about time to post one.

EDIT: Alright, here's a build of just the exe files. Use at your own risk.
Thanks. Is the bit definition ability the only new thing in this use-at-your-own-risk build of the .exe files?

#11 batari OFFLINE  

batari

    )66]U('=I;B$*

  • 6,236 posts
  • begin 644 contest

Posted Sat Oct 25, 2008 2:10 PM

View PostRandom Terrain, on Sat Oct 25, 2008 12:49 PM, said:

View Postbatari, on Sat Oct 25, 2008 12:42 PM, said:

I thought I'd mention that what the OP is trying to do is possible, though in a slightly different way, with builds after about April '07. I don't remember if I posted anything newer than that, but if I did, you can use "def" to redefine a bit definition as something more useful. You would do something like "def GAMEFLAG = a{1}" or something. If no suitable build exists, maybe it's about time to post one.

EDIT: Alright, here's a build of just the exe files. Use at your own risk.
Thanks. Is the bit definition ability the only new thing in this use-at-your-own-risk build of the .exe files?
The def command replaces any string with a string you define yourself, so it works for more than just bits.

I've also added a macro command to define macros, a callmacro command to call them, but I can't remember how they work (I'll investigate this.)

#12 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 20,911 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sat Oct 25, 2008 2:42 PM

Thanks.

#13 jman1093 OFFLINE  

jman1093

    Space Invader

  • 11 posts

Posted Tue Oct 28, 2008 7:15 PM

Quote

The error messages you're getting contain references to things like "z{4}"-- and that's the way you would refer to a bit of one of the variables, so I'm guessing you're trying to dim your own variables to single bits

Actually, that is exactly what I "tried" to do.

After fixing those, it worked!


Thanks for the fast response, I really appreciate it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users