当前位置 : 主页 > 编程语言 > c语言 >

vb6 – 我可以将字符串,单曲等设置为“”并为每个设置为零使用吗?

来源:互联网 收集:自由互联 发布时间:2021-06-24
我有一个记录: Public Loon As LonenRecordType LonenRecord 'Algemeen Status As String * 1 TijdvakNr As Integer TijdvakBegin As String * 10 TijdvakEinde As String * 10 Key As String * 10 WerkgeversNummer As String * 3 WnRecord As Integ
我有一个记录:

Public Loon As LonenRecord

Type LonenRecord
    'Algemeen
    Status As String * 1
    TijdvakNr As Integer
    TijdvakBegin As String * 10
    TijdvakEinde As String * 10

    Key As String * 10
    WerkgeversNummer As String * 3
    WnRecord As Integer
    WerknemerNr As String * 4
    AchterNaam As String * 25
    Voorvoegsel As String * 15
    and lots more
end Type

我想把所有空的都变为“”或零

我可以:

with Loon
    .TijdvakNr  = 0
    .WerkgeversNummer  = ""
etc
end with

有没有更简单的方法,f.i.与每个或任何?

分配到将处于默认状态的新值.

'// return a new LonenRecord
Function ResetLonenRecord as LonenRecord: End Function

然后:

'// overwrite variable
Loon = ResetLonenRecord()
网友评论