Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: LDos problems...  (Read 2603 times)

0 Members and 1 Guest are viewing this topic.

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
LDos problems...
« on: June 01, 2010, 09:10:49 PM »


Hi,

I'm just working through the LDos commands and I seem to have discovered a strange glitch.

Code: [Select]

FILE$="RAM:env/"
L$=Lcat First(FILE$)
Do
N$=Lcat Next
Print "First:";L$
Print "Next:";N$
Print FILE$
` C=Lcat Prot
Print C;" ";
Print L$;" Len(L$)";Len(L$)
Print
Clear Key: Wait Key
Loop



The thing is that L$ and N$ are completely different internal variables used by AMOS, but on my setup when running the above code they end up as the same when using the Print command!! Unless I'm going nuts, I can't see how. (Yes, Do comes AFTER L$=Lcat First(FILE$))

The other thing is that when I used X=Lcat Type(FILE$), the editor crashed when I hit F2 (check syntax).  The correct syntax for Lcat Type is X=Lcat Type, but I was just checking something. I am starting to think that LDos is seriously flawed in it's code (though some of it's commands are useful).

Does anyone else here experience the same problems when using LDos 2.5 with AMOS Pro 2.X?


Regards,
Lonewolf10

Logged

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: LDos problems...
« Reply #1 on: June 03, 2010, 06:06:10 PM »


Mystery solved.

It's the way that LDos works. I used the Varptr function to find the internal address of the 2 variables  (L$ and N$). The address of both is the same!!
If you use additional variables (eg. K$) with either Lcat First or Lcat Next, the variables will point to the same place as the first variable that used Lcat First (L$)!


Regards,
Lonewolf10

Logged

asymetrix

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 56
  • Amos Documentation
Re: LDos problems...
« Reply #2 on: June 04, 2010, 12:51:55 AM »

Im glad you got it solved :-) It looked a bit strange, but im sure there will be others..
Logged

Lonewolf10

  • AMOS Extensions Developer
  • AMOS Dev
  • A2000
  • *****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 618
    • http://www.aliensrcooluk.com
Re: LDos problems...
« Reply #3 on: June 06, 2010, 12:08:10 AM »


Quote

Im glad you got it solved :-) It looked a bit strange, but im sure there will be others..



Yes, you are quite right. All string variable that LDos uses all point to the same location (except when one contains a null value), making all string functions useless. I even tried moving the data into a new string (e.g. NEW$=K$), but that didn't work either. The only way around it (that I assume will work) is to dump all string data, that you wish to keep and use later, into a bank and then peek$ them back into a string variable.
Here I was thinking that new commands should make things easier...


On another note, how many folks here know that you can use single quotes, to replace doubleqoutes in AMOS? Examples:


K$='AMOS strings have so much fun!'
Print 'Rainbows keep "appearing" on my screen!': rem will print "Rainbows keep "appearing" on my screen!"


Regards,
Lonewolf10

Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022