dMZX Forums: How to incorporate strings in file loading? - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to incorporate strings in file loading?

#1 User is offline   A-Guymzx 

  • Bouncin'
  • PipPipPip
  • Group: Members
  • Posts: 225
  • Joined: 19-June 09
  • Gender:Male
  • Location:The Netherlands

Posted 18 July 2013 - 03:08 PM

I'm trying to create a file using a string, like so:
set "data/&$board&.dat" to "fwrite_open"

I also tried using $board_name, But it still gives me a nameless .dat file in my data folder, instead of a file with the actual board name.

How can I get string names to be used in this situation?

This post has been edited by A-Guymzx: 18 July 2013 - 03:09 PM

0

#2 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 18 July 2013 - 03:23 PM

you didn't give the line where you set $board to the actual board name

i assume your code looks like this:

set "$board" "BOARD_NAME"
set "data/&$board&.dat" "fwrite_open"


works fine here. upload a sample .mzx file that exhibits the problem you describe.

EDIT: Alternatively, if your code doesn't set $board to BOARD_NAME, that is the problem. If you don't set a string to something it will be blank by default.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#3 User is offline   A-Guymzx 

  • Bouncin'
  • PipPipPip
  • Group: Members
  • Posts: 225
  • Joined: 19-June 09
  • Gender:Male
  • Location:The Netherlands

Posted 18 July 2013 - 03:35 PM

The thing is, using F11 in test mode has shown me $board is automatically set to $board_name.
I can be wrong here, as it may not actually contain it in reality.

Here's a screen, I have not set $board anywhere in my code, though it does contain the board name.

Edit: Using your method does indeed result in the creation of the correct file. I'm merely confused why it does not do this without using that method, while the debug menu tells me otherwise.

Attached File(s)


This post has been edited by A-Guymzx: 18 July 2013 - 03:38 PM

0

#4 User is offline   smilymzx 

  • Those Goodie-Goodies!
  • PipPipPip
  • Group: Members
  • Posts: 349
  • Joined: 25-October 03
  • Gender:Male
  • Location:I.M.MEEN's book

Posted 18 July 2013 - 09:09 PM

This is one of the reasons this is in the tracker!

Of which, it can be useful in future versions of MZX, uses like this are no exception to this!
SmilyMZX, A.K.A. Hamtaro126 (A.K.A. AtariHacker)

I am at:

Z2 - ZZT forums, NESDEV Forums, SMW Central (Super Mario World)

Other interests:

Museum of ZZT, NESDEV Wiki, Wiki of Weavers (ZZT-related!)
0

#5 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 19 July 2013 - 12:31 AM

View PostA-Guymzx, on 19 July 2013 - 01:35 AM, said:

The thing is, using F11 in test mode has shown me $board is automatically set to $board_name.
I can be wrong here, as it may not actually contain it in reality.

Here's a screen, I have not set $board anywhere in my code, though it does contain the board name.

Edit: Using your method does indeed result in the creation of the correct file. I'm merely confused why it does not do this without using that method, while the debug menu tells me otherwise.


That's still your code, though, even if it's some other robot you've forgotten about. $board is not set to the board name by default - in fact, there are no default strings.

Here is what that screen looks like when testing a new, blank .mzx file:
Posted Image

My guess as to why the file writing code didn't work for you is that the robot that sets $board runs AFTER your robot.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#6 User is offline   A-Guymzx 

  • Bouncin'
  • PipPipPip
  • Group: Members
  • Posts: 225
  • Joined: 19-June 09
  • Gender:Male
  • Location:The Netherlands

Posted 19 July 2013 - 12:16 PM

You're right, I just found the robot that set $board, sorry for the trouble guys.
0

#7 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 03 August 2013 - 02:29 AM

View PostLancer-X, on 18 July 2013 - 08:31 PM, said:

Posted Image


zomg, you modified the default font :r
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

#8 User is offline   CJA 

  • «≡larch bucket≡»
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,262
  • Joined: 23-June 05
  • Gender:Male
  • Location:......@.c....

Posted 03 August 2013 - 03:04 AM

that thin font looks soooooooooo good with mzx's huge, blocky areas, overuse of lines and searing neon colors! :(
Need a dispenser here.
1

#9 User is offline   Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,895
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 03 August 2013 - 04:14 AM

(you can edit the reserved palette too)

((in game anyway))

(((you did it in GRD, you should know!)))
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
0

#10 User is offline   Dr Lancer-X 

  • 電波、届いた?
  • Group: DigiStaff
  • Posts: 8,936
  • Joined: 20-March 02
  • Location:ur mom nmiaow

Posted 03 August 2013 - 07:52 AM

It's a font for writing robotic, basically. I'm used to it so I have to have it everywhere.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(
0

#11 User is offline   Exophase 

  • Laughing on the inside.
  • Group: DigiStaff
  • Posts: 7,155
  • Joined: 23-October 00
  • Gender:Male
  • Location:Cleveland, OH

Posted 07 August 2013 - 05:17 PM

View PostLancer-X, on 03 August 2013 - 03:52 AM, said:

It's a font for writing robotic, basically. I'm used to it so I have to have it everywhere.


Anything that helps you program faster than your usual 300 lines of code per minute is good by me.
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~

"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay

Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users