dMZX Forums: Returning words and "counters"/shorts via string indexing -> Archived Requests -> Tracker

Jump to content

Report ID 466 Title Returning words and "counters"/shorts via string indexing
Product Archived Requests Status Implemented (Severity 1 - Low)
Version 2.84 Fixed in 2.91

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #466: Returning words and "counters"/shorts via string indexing

#1 User is online  
Lachesis 

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

Posted 31 May 2012 - 02:32 AM

I had an idea regarding string indexing: since $string.val always sets/returns a byte, maybe there could be to set/return multi-byte values from string indexing. This would simplify what otherwise turns into a bunch of pretty stupid bitshift constructs (As Seen In & Code Screenshots). Possible methods (in order of author's preference):

1) .word[ind], .counter[ind]
set "counter" $string.counter(32)"

2) .ind#1-4 (4 signed, others unsigned)
set "counter" "$string.32#4"

3) .ind[ub (default), b, uw, w, c/s]
set "counter" "$string.32c"

4) New operators (yeah, like we need to give strings MORE special chars)
yeah I have nothing, suggest something if you think this is a good idea, but I don't think it is

5) ?????
"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


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 8)

#2 User is offline  
Dr Lancer-X 

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

Posted 31 May 2012 - 03:04 AM

I like the first one, it doesn't break the existing model, would be useful and shouldn't be too much work to implement.
Posted Image
<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(

#3 User is online  
Lachesis 

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

Posted 31 May 2012 - 04:49 AM

I think the only issue is that indexing by bytes may potentially confuse users not used to the number of bytes in words/shorts or the concept of little endian, but those users probably wouldn't be using strings anyway.

This is simple enough it could probably make 2.84 except that Terryn would have to cram more things into the help file last minute. 2.85 is just something I put down, but 2.84b is reasonable since the chance of anybody having used "$string.counter103" in a previous game is essentially non-existant.
"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

#4 User is offline  
ajs 

  • carpe diem
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,614
  • Joined: 21-October 00
  • Gender:Male
  • Location:United Kingdom

Posted 31 May 2012 - 05:56 PM

I'd would recommend not hacking in string to counters using bytewise addressing. Robotic is a high level language and has too many low level features already. Until Exo's proposed language improvements are executed, where stuff like this could be made into built-in functions, I wouldn't add it.

Just my 2c.

--ajs.

This post has been edited by ajs: 31 May 2012 - 05:57 PM


#5 User is online  
Lachesis 

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

Posted 08 December 2012 - 04:26 AM

Updating status to: Rejected

Agree. It's better just to let the game author handle this however they like once functions exist.
"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

#6 User is online  
Lachesis 

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

Posted 08 December 2012 - 05:15 AM

Updating version to: None
"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

#7 User is online  
Lachesis 

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

Posted 08 December 2012 - 05:15 AM

Moving to: Rejected Requests

#8 User is online  
Lachesis 

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

Posted 25 February 2019 - 08:55 PM

Updating status to: Implemented
Updating severity to: 1 - Low
Updating version to: 2.84
Issue fixed in: 2.91

Turns out this was actually implemented as #2 in the initial post and this kind of rules as a feature now we have it. Oops :(/>
"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

#9 User is online  
Lachesis 

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

Posted 25 February 2019 - 08:55 PM

Moving to: Archived Requests


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

1 User(s) are reading this issue
1 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2024  IPS, Inc.