Re: Script to format file to character number locations?
From: Matthias Tacke (Matthias_at_Tacke.de)
Date: 01/18/05
- Next message: Torgeir Bakken \(MVP\): "Re: Help with reading remote registries"
- Previous message: Torgeir Bakken \(MVP\): "Re: Retrieving file creation date for appending to archive file"
- In reply to: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Next in thread: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Reply: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Reply: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 Jan 2005 18:47:21 +0100
Sean M. Loftus wrote:
> I'm getting a syntax error on this snippet...
>
> UML_PSInputScript.VBS(111, 14) Microsoft VBScript compilation error: Syntax
> error
>
> Function FixLength(sText,iSize)
> FixLength = Left(sText & Space(iSize), iSize)
> End Function
>
Just checked again without errors:
==screen=copy=================================================================
C:\test\vbs>cscript Fixlength.vbs
1 2 3 4 5 6 7
1234567890123456789012345678901234567890123456789012345678901234567890123456789
First name starts at char 1
Last name starts at char 15
account starts at char 25
email starts at char 50
Matthias WalteTacke don't know what you have Matthias.Tacke@web.de
==screen=copy=================================================================
' FixLength.vbs
option explicit
dim First, Last, account, email, RetString
First = "Matthias Walter"
Last = "Tacke"
account = "don't know what you have here"
email = "Matthias.Tacke@web.de"
RetString = FixLength(First, 14) & _
FixLength(Last, 10) & _
FixLength(account, 25) & email
wscript.echo " 1 2 3 4 5 6 7"
wscript.echo "1234567890123456789012345678901234567890123456789012345678901234567890123456789"
wscript.echo "First name starts at char 1"
wscript.echo " Last name starts at char 15"
wscript.echo " account starts at char 25"
wscript.echo " email starts at char 50"
wscript.echo RetString
Function FixLength(sText,iSize)
FixLength = Left(sText & Space(iSize), iSize)
End Function
==screen=copy=================================================================
C:\test\vbs>Fixlength.vbs
1 2 3 4 5 6 7
1234567890123456789012345678901234567890123456789012345678901234567890123456789
First name starts at char 1
Last name starts at char 15
account starts at char 25
email starts at char 50
Matthias WalteTacke don't know what you have Matthias.Tacke@web.de
==screen=copy=================================================================
HTH
-- Gruesse Greetings Saludos Saluti Salutations Matthias ---------+---------+---------+---------+---------+---------+---------+
- Next message: Torgeir Bakken \(MVP\): "Re: Help with reading remote registries"
- Previous message: Torgeir Bakken \(MVP\): "Re: Retrieving file creation date for appending to archive file"
- In reply to: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Next in thread: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Reply: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Reply: Sean M. Loftus: "Re: Script to format file to character number locations?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|