zeros are ok, but they have to be at the beginning, not the end
3 resulted in the name "Var30000"
but the name is not the biggest issue, for some reason it doesnt read/write properly (maybe it writes OK, but doesnt read right, or the other way around, which both result in the output being zero)
no errors, but the output is zero
edit: I forgot to push de before _arc_unarc (so it got destroyed..) not too clever..
New Appvar utility
Moderator: MaxCoderz Staff
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
Last edited by King Harold on Thu 10 Aug, 2006 6:51 pm, edited 1 time in total.
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
Ok, well it would be a lot easier to conver 3 into Var3_ _ _ _ (four spaces) than to move it over to 00003. Plus, you'd have a wider selection of variable names available.
ld hl,var_name+9
reformat_loop:
ld a,(hl)
sub a,30
jr nz,done
ld (hl),a
dec hl
jr reformat_loop
done:
that should null-terminate the appvar right after the last digit. (So Var3 would be Var3 and not Var30000). However, Var30 would be truncated to Var3, although Var301 would be fine.
We could also use the second byte in OP1 to determine how many values to store into the label. I'll give you an example in the help programming section.
ld hl,var_name+9
reformat_loop:
ld a,(hl)
sub a,30
jr nz,done
ld (hl),a
dec hl
jr reformat_loop
done:
that should null-terminate the appvar right after the last digit. (So Var3 would be Var3 and not Var30000). However, Var30 would be truncated to Var3, although Var301 would be fine.
We could also use the second byte in OP1 to determine how many values to store into the label. I'll give you an example in the help programming section.
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
cant we do this?
although 300 would become 3 unless there is a real good algorithm
although 300 would become 3 unless there is a real good algorithm
Last edited by King Harold on Thu 10 Aug, 2006 10:17 am, edited 1 time in total.
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm
-
- Calc King
- Posts: 1513
- Joined: Sat 05 Aug, 2006 7:22 am
-
- Extreme Poster
- Posts: 340
- Joined: Fri 07 Jul, 2006 2:39 pm