• Welcome to Jose's Read Only Forum 2023.
 

Fixed length strings in type

Started by James C. Fuller, June 08, 2019, 05:12:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller

Charles,
  What is the best way to declare fixed length strings in a type.
I'm not sure if this worked before but it now fails when assigning:
ASSEMBLER:
ERR:   fistp [rbp-472]!!  Expect FPU type: word,dword,qword,eword

Type AddressType
    FirstName As zstring * 32
    LastName  As zstring * 32
    Company    As zstring * 64
    Address    As zstring * 64
    City As zstring * 32
    County As zstring * 32
    State As zstring * 4
    Zip As zstring * 12
    Phone1      As zstring * 24
    Phone2      As zstring * 24
    Email      As zstring * 64
    Url        As zstring * 64
End Type

Dim As AddressType Address

fields = GetFields(sLine,chr(9))
    With Address
        .FirstName    = arg(1)
        .LastName     = arg(2)
        .Company      = arg(3)
        .Address     = arg(4)
        .City        = arg(5)
        .County      = arg(6)
        .State       = arg(7)
        .Zip         = arg(8)
        .Phone1      = arg(9)
        .Phone2      = arg(10)
        .Email       = arg(11)
        .Url         = arg(12)
    End With   
'==============================================================================

But if I use:

Type AddressType
    char FirstName[32]
    char LastName[32]
    char Company[64]
    char Address[64]
    char City[32]
    char County[32]
    char State[4]
    char Zip[12]
    char Phone1[24]
    char Phone2[24]
    char Email[64]
    char Url[64]
End Type

'==============================================================================
every thing is fine.

James

Charles Pegge

Hi James,

this notation has been dropped

Company      As zstring * 64

but these work:

char Company[64]
zstring Company[64]
Company[64] as char
Company[64] as zstring



James C. Fuller

Charles,
  Ok.
  Don't forget to add these to "type" in your recently uploaded git docs.
James