Author Topic: Path lenght? LEN  (Read 6048 times)

0 Members and 2 Guests are viewing this topic.

Aurel

  • Guest
Path lenght? LEN
« on: November 13, 2015, 02:05:31 PM »
hello boys...
Something is very wrong with file path len calculated with oxygen.
Talking about file path with Mike on bp.org i found why my interpreter
not respond when file name have space...
because is calculated wrong.
so i tested to see what is file name and looks fine
but when i try to get proper file name lenght which is 39 i get 47  :o
how is that possible?

Aurel

  • Guest
Re: Path lenght? LEN
« Reply #1 on: November 14, 2015, 02:48:27 PM »
still no answer...but i found bug or garbage problem:

FUNCTION Trim(string Main$="" ) As String
   String res$=""
   res$ = Rtrim(Main$)
     Return Ltrim(res$) ' this exit with garbage char "F"
End FUNCTION

as you can see function LTrim return F
is that fixed because i use older version?

Mike Lobanovsky

  • Guest
Re: Path lenght? LEN
« Reply #2 on: November 15, 2015, 04:41:21 AM »
No bugs nor garbage seen here:

Code: OxygenBasic
  1. Include "$\inc\console.inc"
  2.  
  3. #LookAhead
  4.  
  5. Print "'" + Trim("   blabla   ") + "'"
  6.  
  7. WaitKey
  8.  
  9. Function Trim(String s) As String
  10.    Return Ltrim(Rtrim(s))
  11. End Function
  12.  

prints

Quote from: console
'blabla'

Do you ever try to load newer versions yourself to see what's been fixed and what's not?

Aurel

  • Guest
Re: Path lenght? LEN
« Reply #3 on: November 15, 2015, 09:13:09 AM »
Quote
Do you ever try to load newer versions yourself to see what's been fixed and what's not?

yes of course ..what you think ?
but new or new-er version have so strange quirks that i cannot believe .
first of all i blame Oxygen tooo liberal syntax.
there is no such a string-problems in other BASICS.
i don't want to blame Charles for every tiny bug BUT that is real s*
because Oxygen is really great compiler and still suffer from such a bugs.
 >:(

Aurel

  • Guest
Re: Path lenght? LEN
« Reply #4 on: November 15, 2015, 10:17:25 AM »
by the way which version is latest bug.fixed ?
Charles said that he can compile AsciEdit but ruben is another story  ::)

Mike Lobanovsky

  • Guest
Re: Path lenght? LEN
« Reply #5 on: November 15, 2015, 12:18:17 PM »
first of all i blame Oxygen tooo liberal syntax.

Syntax in O2 is only as liberal as you would allow it to be. There is absolutely nothing that forbids you to write your code consistently, say, in camel case, utilize As Long and As String instead of int and char*, and Declare instead of !, and % instead of #define, and properly preformat and put your snippets in between {code=o2}{/code} or {code=c}{/code} tags (here {} stand for [] to make the tags visible). This will also display how much you respect, and care for, those who will come and see your submissions after you and who probably will offer help if needed if they like what they see and equally probably not if they don't. The style you choose for in-house development is entirely up to you while the style you expose to people had better be nice.

Quote
i don't want to blame Charles for every tiny bug BUT that is real s*

You shouldn't because OxygenBasic is a work in progress that's objectively here and will go on in the future regardless of whether Aurel's subjective ego is still around or no more. No reason to compare the incongruous.

Quote
by the way which version is latest bug.fixed

Scroll up to the Wizard at the top of this page and see the date beneath his feet. Click the Wizard to download the package.

Charles Pegge

  • Guest
Re: Path lenght? LEN
« Reply #6 on: November 15, 2015, 01:40:32 PM »
Aurel,

Your function is not very clean, but it does work with the current o2 using this example:

Code: OxygenBasic
  1. FUNCTION Trim(string Main$="" ) As String
  2.    String res$=""
  3.    res$ = Rtrim(Main$)
  4.      Return Ltrim(res$) ' this exit with garbage char "F"
  5. End FUNCTION
  6.  
  7. print ">" & trim("  abc def  ") & "<" 'result: >abc def<
  8.  

Aurel

  • Guest
Re: Path lenght? LEN
« Reply #7 on: November 15, 2015, 02:27:34 PM »
Yes this small example return clean string but
when is function called from bigger program then
Ltrim return garbage.

for Mike...
one thing is progres but another thing is stability.
it is not very smart built new features when we have old problems
(read quirks or bugs)...right?
i repeat i am not against new features but i expect that most standard
features which work properly in other compilers that work properly in Oxygen to...
do I want impossible things?

..and please stop share your ultra-smart vibrations
« Last Edit: November 15, 2015, 02:35:09 PM by Aurel »

Mike Lobanovsky

  • Guest
Re: Path lenght? LEN
« Reply #8 on: November 15, 2015, 06:58:25 PM »
..and please stop share your ultra-smart vibrations

Done as requested, Aurel! You've been put to my personal quarantine again until after the New Year. :)

JRS

  • Guest
Re: Path lenght? LEN
« Reply #9 on: November 15, 2015, 08:36:05 PM »
Quote from: Aurel
..and please stop share your ultra-smart vibrations



Careful Mike, you have super human computational powers that can cause spontaneous massive confusion.  8)


Charles Pegge

  • Guest
Re: Path lenght? LEN
« Reply #10 on: November 16, 2015, 07:28:05 AM »
Yes this small example return clean string but
when is function called from bigger program then
Ltrim return garbage.

Have you checked the state of the input string?

Aurel

  • Guest
Re: Path lenght? LEN
« Reply #11 on: November 16, 2015, 10:30:35 AM »
Quote
Have you checked the state of the input string?
Yes Charles i did..of course
as i say this function not work properly
because when i use just RTrim...then nothing->OK
but when i use Ltrim with empty input then i get char F.... >:(

Charles Pegge

  • Guest
Re: Path lenght? LEN
« Reply #12 on: November 17, 2015, 06:31:39 AM »

What string inputs have you used?

Aurel

  • Guest
Re: Path lenght? LEN
« Reply #13 on: November 18, 2015, 04:19:03 AM »
Quote
What string inputs have you used?
Charles i use in my interpreter full file path name
and i get wrong result in number of chars
then when is imput "" string i get this char F

Charles Pegge

  • Guest
Re: Path lenght? LEN
« Reply #14 on: November 18, 2015, 07:36:44 AM »
Have you tried injecting specific strings into the Trim function? (Apart from the file path name)