Author Topic: Fixed length strings in type  (Read 791 times)

0 Members and 1 Guest are viewing this topic.

Offline James C. Fuller

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 595
  • User-Rate: +11/-8
Fixed length strings in type
« on: June 08, 2019, 05:12:37 PM »
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
Code: [Select]
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:
Code: [Select]
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
« Last Edit: June 08, 2019, 10:15:11 PM by James C. Fuller »

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 672
  • User-Rate: +27/-1
    • Charles Pegge
Re: Fixed length strings in type
« Reply #1 on: June 08, 2019, 11:16:43 PM »
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



Offline James C. Fuller

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 595
  • User-Rate: +11/-8
Re: Fixed length strings in type
« Reply #2 on: June 09, 2019, 04:10:57 PM »
Charles,
  Ok.
  Don't forget to add these to "type" in your recently uploaded git docs.
James