Jump to content

User talk:MichaelWodrich: Difference between revisions

No edit summary
Line 1:
=={{header|XProfan}}==
Delimiter in string "#" or ";" will be ignored.
<lang xprofan>
// http://xprofan.de/start.htm
// https://www.paules-pc-forum.de/forum/board/104-xprofan/
 
// strip_comments()
 
Proc Min
Declare int PC, i, float e, t
Line 28 ⟶ 24:
Declare int posi[]
Declare int i, min_p, p
 
min_p = $7FFFFFFF
For i, 1, Len(delim)
Line 36 ⟶ 31:
posi[ 0 ] = InStr( chr$(34), s )
 
If (posi[0] > 0) and (posi[0] < min_p) // if there is a string delimiter on the left side...
If (posi[0] > 0) and (posi[0] < min_p)
If Odd( Len( Left$(s,min_p) ) - Len( translate$( Left$(s,min_p), Chr$(34), "" )) ) // ...and counting of delimiter is odd, then the sign is part of a string
// ...and counting of delimiter is odd, then the sign is part of a string
 
If Odd( Len( Left$(s,min_p) ) - Len( translate$( Left$(s,min_p), Chr$(34), "" )) ) // ...and counting of delimiter is odd, then the sign is part of a string
p = posi[ 0 ] + 1
min_p = $7FFFFFFF
Line 54 ⟶ 50:
posi[ 0 ] = InStr( chr$(34), s, p )
 
If (posi[0] > 0) and (posi[0] < min_p) // if there is a string delimiter on the left side...
If (posi[0] > 0) and (posi[0] < min_p)
If Odd( Len( Left$(s,min_p) ) - Len( translate$( Left$(s,min_p), Chr$(34), "" )) ) // ...and counting of delimiter is odd, then the sign is part of a string
// ...and counting of delimiter is odd, then the sign is part of a string
If Odd( Len( Left$(s,min_p) ) - Len( translate$( Left$(s,min_p), Chr$(34), "" )) ) // ...and counting of delimiter is odd, then the sign is part of a string
p = posi[ 0 ] + 1
min_p = $7FFFFFFF
Line 66 ⟶ 64:
EndIf
EndIf
 
Return Trim$( Left$( s, min_p - 1 ) )
EndProc
Cookies help us deliver our services. By using our services, you agree to our use of cookies.