* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: Porting TI-BASIC to HP PPL  (Read 1905 times)

0 Members and 1 Guest are viewing this topic.

Offline gogogoluke

  • Full User
  • Join Date: Dec 2015
  • Location:
  • Posts: 22
  • Post Rating Ratio: +0/-0
    • gogogoluke
    • @gogogoluke
    • gogogoluke
    • /u/gogogoluke
    • gogogoluke
  • Gender: Male
Porting TI-BASIC to HP PPL
« on: January 06, 2016, 07:41:31 pm »
I was porting some code to my new HP Prime, but I ran into a problem. I cannot find an alternative to the code "B》dim(LZ)", as it produces the error "Invalid input". What is a good alternative to setting the size of a list (or matrix) from a variable?

Entire TI-BASIC code (For context, nobody port this for me):
(click to show/hide)
« Last Edit: January 06, 2016, 07:45:04 pm by gogogoluke »


  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18520
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #1 on: January 06, 2016, 07:59:06 pm »
Heya gogoluke and welcome to the forums. I don't remember what is the exact syntax to set a list dimension, but one trick I found that worked was to set a value to the highest list element you wanted.

For example, in Tunnel, I wanted my list to be 512 elements, so I just stored 0 in element 512 and it set the list dimension for me (or maybe it set it to 513? I forgot if lists start at 0 or 1 in HP PPL). That trick doesn't work if you want to set the list to a lower dimension afterwards, though (it only works upwards).

Code: [Select]
0►LZ(B);
(I actually wish that there was a TI-BASIC interpreter written in HP PPL, so that no porting would have been necessary, but since that doesn't exist yet)

Perhaps @alexgt might know if there is an actual dim command on the HP Prime?
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline gogogoluke

  • Full User
  • Join Date: Dec 2015
  • Location:
  • Posts: 22
  • Post Rating Ratio: +0/-0
    • gogogoluke
    • @gogogoluke
    • gogogoluke
    • /u/gogogoluke
    • gogogoluke
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #2 on: January 06, 2016, 08:12:34 pm »
Thanks, and I wish that there was an interpreter too, would be a lot faster than manually porting all of my programs. There is a dim function, but it appears to only report list/matrix dimensions, not set them. Lists are started at 1 in Non-CAS mode, but in CAS it starts at 0. On another note, what is the alternate for FILL(1,LZ)? (The game keeps track of HP via lists)
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18520
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #3 on: January 06, 2016, 08:32:33 pm »
Hm interesting that HP would let us view dimensions, but not set them. That seems rather limiting when it's like one of the most fundamental features of lists and matrices in maths. I don't exactly remember if there is a FILL command, but since HP PPL runs so fast, you can probably fill the elements one by one via a FOR loop and it will almost be instant.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline gogogoluke

  • Full User
  • Join Date: Dec 2015
  • Location:
  • Posts: 22
  • Post Rating Ratio: +0/-0
    • gogogoluke
    • @gogogoluke
    • gogogoluke
    • /u/gogogoluke
    • gogogoluke
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #4 on: January 06, 2016, 08:38:50 pm »
I was hoping that wasn't the case, but at least it will be fast. I'm not filling insane amounts of list items anyways, so it shouldn't be a problem even if it were TI-BASIC.
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #5 on: January 06, 2016, 09:48:00 pm »
Use the MAKELIST(Expr,Var,Start,End) command :P

Or I can make a program for UtilPack ;)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18520
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #6 on: January 07, 2016, 12:54:28 am »
Ideally it would be best for him to use standalone solutions for now, since UltiPack dev is stalled for now. But thanks for the command. Does that set his list dimension alex?
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #7 on: January 07, 2016, 01:15:06 pm »
yep Expr is the equation that you want evaluated (or just put zero in there if you want it to be a fresh list). Var is the variable you want to be a list and then just put 1 for the start and the DIM you want for End ;)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Offline gogogoluke

  • Full User
  • Join Date: Dec 2015
  • Location:
  • Posts: 22
  • Post Rating Ratio: +0/-0
    • gogogoluke
    • @gogogoluke
    • gogogoluke
    • /u/gogogoluke
    • gogogoluke
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #8 on: January 07, 2016, 06:48:16 pm »
Thank you. Do you happen to know of an alternative to output()? It appears to not exist for HP Prime.
  • Calculators owned: HP Prime, TI-84CSE
HP Prime, TI-84+CSE
Former Minecraft server owner
HP Prime enthusiast.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18520
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #9 on: January 07, 2016, 07:32:42 pm »
No, but there is an alternative to Text(), which is TEXTOUT_P() . Also Instead of ClrHome or ClrDraw you can use RECT_P(#FFFFFF).
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #10 on: January 08, 2016, 01:45:22 am »
You can use some maths and take advantage of TEXTOUT_P(), like what DJ said. all of the characters except some special chars take up the same amount of pixels if that helps ;)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Original 5
  • CodeWalrus Supporter
  • *
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18520
  • Post Rating Ratio: +95/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #11 on: January 08, 2016, 08:21:16 am »
Wait, HP PPL text is monospace? O.O I thought it wasn't. That's good to know, because on the 83+ text on the graph screen wasn't.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #12 on: January 08, 2016, 01:02:54 pm »
Well, at least for the built in program editor it is, but I am pretty sure it is also monospaced in regular TEXTOUT_P() functions but I haven't needed it to be so I haven't tested it.
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Offline Strontium

  • Full User
  • Join Date: Apr 2015
  • Location: CA
  • Posts: 232
  • Post Rating Ratio: +3/-2
  • hey
    • Unilunge
    • /u/thismarkstheend
    • Azmarok
  • Gender: Female
Re: Porting TI-BASIC to HP PPL
« Reply #13 on: January 09, 2016, 05:38:12 am »
Last I tried doing something with text on the HP Prime, the text was definitely not monospaced. Unless something has changed since then.
  • Calculators owned: TI Nspire CX, HP Prime
  • Consoles, mobile devices and vintage computers owned: NES

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
  • Gender: Male
Re: Porting TI-BASIC to HP PPL
« Reply #14 on: January 09, 2016, 06:06:45 am »
really?! it must be only in CAS, Homeview, NOtes, and the Editor because I know they are in there.
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games