News:

*NEW* Current Version on STEAM16.793

Webchat:
Visit the chat



STRING$

Previous topic - Next topic

MrTAToad

One command that would be nice is to have a command that will duplicate a character (or perhaps the complete contents of a string), a given number of time.

Neurox

Quote from: MrTAToad on 2010-Nov-26
One command that would be nice is to have a command that will duplicate a character (or perhaps the complete contents of a string), a given number of time.

Code (glbasic) Select

// ------------------------------------------------------------- //
// -=#  F_STRING$  // Replica per n°volte la lettera passata#=-
// ------------------------------------------------------------- //
FUNCTION F_string$: wnvolte,wcar$
LOCAL writ$,wl
writ$ = ""
FOR wl = 1 TO wnvolte
   writ$ = writ$ + wcar$
NEXT
RETURN writ$
ENDFUNCTION // F_string$


Bye bye,
Neurox/Paolo
Paolo Borzini | paolo@borzini.it
The WhiteFly Software | www.thewhitefly.it
Service on line for screen printers | www.4pellicole.it

MrTAToad

I actually use :

Code (glbasic) Select
FUNCTION space$:amount%
LOCAL temp$

temp$=""
WHILE amount%>0
temp$=temp$+" "
DEC amount%
WEND

RETURN temp$
ENDFUNCTION