Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows version 1.0.4 released
#1
This is just a minor bug fix.

Objects

Objects can now properly be assigned to object array references in functions. Earlier, a function like the one below would cause a runtime error:

Code:
procedure assign(&objects?[], object?)
  objects[0] = object
endproc


System
For some reason, the system command did absolutely nothing on Windows (although the undocumented shellexecute did), but it's functioning now.

Code:
system "dir & echo hello world & pause"

If you want to capture the output, I suggest you pipe it to a file and read it from there for now:

Code:
' Get a list of files in the current directory.
system "dir /b > temp.txt"
open file 0, "temp.txt"
...


Mouse

set mouse <x>, <y> was a bit bugged but has been fixed now. After calling the command, the mousex() and mousey() functions would return incorrect values until the user moved the mouse and new coordinates were registered.
Reply
#2
Nice fix.

 My computer made me take out the previous version before I could use it.

 Some kind of name conflict.

 The system command opens up a whole new bunch of experiments. For instance it is possible to use the command line while the NaaLaa program is running.

System "cmd"

very cool.
Reply
#3
(03-24-2019, 12:31 AM)Rick3137 Wrote: Nice fix.

 My computer made me take out the previous version before I could use it.

 Some kind of name conflict.

 The system command opens up a whole new bunch of experiments. For instance it is possible to use the command line while the NaaLaa program is running.

System "cmd"

very cool.


Yeah, the system command is the easy way. But if you need to do stuff in the background, without having a console window popup, you can use the shellexecute command. 

For example, if you want to execute "dir /b *.png > png_files.txt" to put a list of all png files in the current directory into a file png_files.txt (/b strips all information but the actual file names), you could call:



Code:
shellexecute "open", "cmd", "", "/c dir /b *.png > png_files.txt", true

And if you want to create a new folder named doop:

Code:
shellexecute "open", "cmd", "", "/c mkdir doop", true


I believe the syntax is:

Code:
shellexecute <operation>, <file>, <directory>, <parameters>, <wait_until_operation_is_done>

But I'm not quite sure, and I don't have the information available at this moment. It's used in NED to launch the compiler, and that's the only reason the command was added, haha Smile


I have no idea of why the system command hasn't been working for a long time. The C code had actually been commented out, maybe by mistake, who knows. Because I remember using it when dealing with FTP stuff in a naalaa program many years ago.
Reply
#4
I made a small change, fixed a problem with set mouse and updated the installer without changing the version number.
Reply
#5
Yeah, I have to uninstall the old version every time too Sad I'm using some program to generate the installers. Even though only two files have changed and I set it up for patching, the behavior is the same. I must be doing something wrong.
Reply
#6
Great news, thanks for the info and update.
Reply
#7
Yo marcus

and where is download link?
Reply
#8
Hello Marcus:

  While you are still working on key board functions, there are a few that would help for making games. I have been spinning my wheels for several weeks on a game that could use these.

 OnKeyUp( 37 )
 OnKeyDown( 39 )

 I would like to run a procedure when a key is pressed, or released.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)