English
Source / code snippets

functions Glchar Grchar Rmid String

 

Michael
Dell
gRChar$(s,n):
s = input String
n = position the characters (of right)

Result: the Nte characters of right.

gLChar$(s,n):
s = input String
n = characters number (of left)

Result: the Nte characters of left.

rMid$(s,n1,n2):
s = input String
n1 = Startposition (of right)
n2 = Number of characters

Result: Teilstring (of right to left)

are n1 and/or n2 = -1 becomes the whole String inverse zurückgegeben.

functions (gRLCHar.pinc):
CompileMarkSeparation
Def gRChar$(2) Left$(Right$($(1),&(2)),1)
Def gLChar$(2) Mid$($(1),&(2),1)

Proc rMid$

    Parameters rM_In1$,rM_In2&,rM_In3&

    If ((rM_In2& = -1) | (rM_In3& = -1)): rM_In2& = 1: rM_In3& = Len(rM_In1$): EndIf

        Case ((Len(rM_In1$) < 1) | (rM_In2& < 1) | (rM_In3& < 1) | (rM_In2& > Len(rM_In1$)) |
        (rM_In3& > (Len(rM_In1$) - (rM_In2& - 1)))): Return -1  Eingabe Fehler
        Declare rM_Out$

        WhileLoop rM_In2&,((rM_In2& - 1) + rM_In3&)

            rM_Out$ = (rM_Out$ + Left$(Right$(rM_In1$,&Loop),1))

        EndWhile

        Return rM_Out$

    ENDPROC

demonstration:
CompileMarkSeparation
 $I gRLCHar.pinc
Var Test$ = "ABCDEFGH"
Cls
Print "gRChar$(Test$,2)  = "; gRChar$(Test$,2)
Print
Print "gLChar$(Test$,2)  = "; gLChar$(Test$,2)
Print
Print "rMid$(Test$,2,2)  = "; rMid$(Test$,2,2)
Print
Print "rMid$(Test$,1,9)  = "; rMid$(Test$,1,9)
Print
Print "rMid$(Test$,-1,0) = "; rMid$(Test$,-1,0)
WaitInput
End
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
07/22/08  
 




Jac
de
Lad
gLChar$=Mid$ ???
 
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE)
Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP
07/22/08  
 




Michael
Dell
Yes, have right I Have there of gRChar$() directly on gLChar$() umgesetzt without drüber to think. Habs through Mid$(s,n,1) supplant. Thanks you!
 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
07/23/08  
 




RGH
... and ex XProfan 11 can gRChar$(s,n) and gLChar$(s,n) through SubStr$(s,n) and SubStr$(s,-n) supplant or. define: If with SubStr$ no Separator indicated becomes, becomes each single characters as Teilstring viewing.

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
07/23/08  
 




Michael
Dell
class Roland, on it I had yet none virtual!

you functions for XProfan11:
CompileMarkSeparation
Def gRChar$(2) SubStr$($(1),(&(2) - (&(2) * 2)))
Def glChar$(2) SubStr$($(1),&(2))

Proc rMid$

    Parameters rM_In1$,rM_In2&,rM_In3&

    If ((rM_In2& = -1) | (rM_In3& = -1)): rM_In2& = 1: rM_In3& = Len(rM_In1$): EndIf

        Case ((Len(rM_In1$) < 1) | (rM_In2& < 1) | (rM_In3& < 1) | (rM_In2& > Len(rM_In1$)) |
        (rM_In3& > (Len(rM_In1$) - (rM_In2& - 1)))): Return -1  Eingabe Fehler
        Declare rM_Out$

        WhileLoop rM_In2&,((rM_In2& - 1) + rM_In3&)

            rM_Out$ = (rM_Out$ + SubStr$(rM_In1$,(&Loop - (&Loop * 2))))

        EndWhile

        Return rM_Out$

    ENDPROC

 
Salu Michael...

Hab zwar krumme Fieß awer dofir e' ecklich Gsicht! 
07/23/08  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

7.257 Views

Untitledvor 0 min.
RudiB.12/06/21
Normann Strübli06/07/20
Ernst04/06/14
Chregu Mueller03/23/14

Themeninformationen

this Topic has 3 subscriber:

Michael Dell (3x)
RGH (1x)
Jac de Lad (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie