I've to create an order file. Its format is specified, means each field of a data record has a fixed length.
All fields are right-justified. A field can contain numeric or alpha chars.
If numeric chars are used the field has to be padded with zeros. Thats no problem with AHK.
Quote:
Var = 12
SetFormat, float, 06.0
Var += 0 ; Sets Var to be 000012
But with literals there's
no such option
Quote:
Var = ABCDEFGH
SetFormat, alpha, 30
Var += 0 ; Sets Var to be a 30 char string padded with spaces
Currently it needs some math

and a Loop
Code:
Alphas = ABCDEFGH
FieldLen = 30
StringLen, NumAlphas, Alphas
FieldLen -= %NumAlphas%
Loop, %FieldLen%
{
FileAppend, %A_Space%, C:\MyFile.txt
}
FileAppend, %Alphas%, C:\MyFile.txt
As there's a slight chance that I've overseen something in the helpfile, I've made that request here - instead on the wish list.