So far there are some math symbols that perform some operations as +=, *=, -=, /= and \=.
I miss an OR-operative assignement as "|=" and by that logical "&=" with numbers would be AND.
Confusing &= and += does the same to strings and only in one direction...
Were this XOR "~=" with numbers
then the same symbols i woul suggest to reverse concatenate
while
A$ &= B$
equals
A$ = A$ & B$
and also
A$= A$ + B$
there could be some more implicit assignements that allow fast string operations as:
A$ ~= B$..........A$ = B$ & A$
would mean to put B$ in front of A$
A$ -= B$............ A$ = Remove$(A$, B$)
remove all occurences of B$ from A$
A$ /= B$ ....... A$ = LeftF$(A$, Instr(-1, A$, B$)-1 ): A$ = RightF$(A$, Lenf(A$) -( Instr(1, A$, B$) + Lenf(B$)-1))
divide A$ into the part between first and last occurence of B$
e.g.
A$ = "C:\myPath\myFile.ext"
B$ = ""
A$ /= B$ results in A$ = "myPath"
A$ \= B$..........A$ = TRIM$(A$, B$)
integer divison has something in common with Trim$ anyway. The truncation.
A$ *= x ............. A$ = Repeat$(x, A$)
Obvious that x must be a number
(thinkable also Strings valid for x as "ONE", "TWO", "FIVE", "SEVEN", "THREEHUNDREDFORTYFIVE")
The "!=" from other languages known logical NOT is no operator by itself and the "!"-symbol seems to be occupied for power basic alike asm-implementation but not functional. Since it should be "AND NOT", "OR NOT" & "XOR NOT" maybe it makes sense to use the ! instead of "=" as "&!", "|!" & "~!" for numeric logic ops
the strings to trim <~, >~
A$ <- B$......A$ = LTrim$( A$, B$ )
A$ >- B$......A$ = RTrim$(A$, B$ )
to truncate Strings incl. B$ <!, >!
A$ >! B$........A$ = Rightf$(A$, Lenf(A$)-(Instr(-1, A$, B$)+Lenf(B$)-1))
truncate everything incl. the last contained occurence of B$ (keep the right part)
A$ <! B$........A$ = Leftf$(A$, Instr(1, A$, B$) - 1)
truncate all of A$ that starts at the first occurence of B$ (keep the left part)
e.g.
A$= "c:\mypath\myFile.ext"
>! .... result "ext" when B$ = "." , result "myFile.ext" when B$ = "\"
A$>!"" : A$ >!"." : Print A$ .... will print out "myFile"
<! ..... result "C:" when B$=""
A$-=(A$>!""): Print A$ .... will print out "C:\myPath"
A$ >& B$ ...... A$ = UCASE$(A$ & B$)
A$ <& B$ ...... A$ = LCASE$(A$ & B$)
A$ >~ B$ .......A$ = UCASE$(B$ & A$)
A$ <~ B$ ........A$ =LCASE$(B$ & A$)
IMO .Net died from Lack of overview caused long "snakes" of code that span across the screen with many hundred chars per line so nobody was ever able to read a full row without to scroll it left and right.
Last edited by ReneMiner; 01-10-2022 at 02:43.
I think there are missing some Forum-sections as beta-testing and support
You sure have great imagination Renč!
Will study your suggestions, I like many of them but it depends if I will corrupt any back compatibility.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks