SET num1 TO 1
SET num2 TO 3.3
SET sum TO $'''1 + 2'''
SET sum2 TO num1 + num2
SET sum3 TO $'''%num1%+%num2%'''
SET Textnum TO $'''%'1'%'''
SET dif TO 2 -5
SET dif2 TO 1 - dif
SET mul TO 5 * 2
SET mul2 TO dif + dif2 * mul
SET mul3 TO (dif + dif2) * mul
SET div TO 10 / 3
> error
> DISABLE SET div2 TO 3 / 0
SET mod1 TO 10 mod 3
SET mod2 TO mul2 mod mul3
SET var1 TO 0
SET var1 TO var1 + 1
Variables.IncreaseVariable Value:var1 IncrementValue: 1 IncreasedValue=> var1
PAD变量(2)文本类型
SET NewVar TO $'''As400哈哈'''
SET Len TO NewVar.Length
SET IsEmpty TO NewVar.IsEmpty
SET Upper TO NewVar.ToUpper
SET Lower TO NewVar.ToLower
SET NewVar2 TO $''' As400 '''
SET Trim TO NewVar2.Trimmed
/# #####################
合并文本值
######################/
SET mod1 TO 2
SET mod2 TO 7
SET text1 TO $'''%'Hello'%'''
SET text2 TO $'''PAD爱好者'''
SET text3 TO $'''%text1% %text2%'''
SET text4 TO text1 + ' ' + text2
SET text5 TO text1 + mod1 * mod2
/# #####################
空白文字
######################/
SET text6 TO $'''%' '%'''
SET text7 TO $'''%' '%'''
SET text8 TO $'''%''%'''
/# #####################
文本值切片
######################/
SET text9 TO $'''ABCDEFGHIJ'''
SET SliceText TO text9[2]
SET text10 TO text9[4:]
SET text11 TO text9[:4]
SET text12 TO text9[2:7]
PAD变量(3)日期时间类型
DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
SET DayOfWeek TO CurrentDateTime.DayOfWeek
SET CurrentYear TO CurrentDateTime.Year
SET date TO D'2022/06/01 00:00:00'
DateTime.Subtract FromDate:date SubstractDate:CurrentDateTime TimeUnit: DateTime.DifferenceTimeUnit.Days TimeDifference=> TimeDifference
DateTime.Add DateTime:date TimeToAdd:1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> AddDate
Text.ConvertDateTimeToText.FromCustomDateTime DateTime:AddDate CustomFormat: $'''yyyy-MM-dd''' Result=> FormattedDateTime
/# >>>
日期时间类型的应用#/
/# ↓↓↓↓
获取本月1号当前时间#/DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
DateTime.Add DateTime:CurrentDateTime TimeToAdd:-CurrentDateTime.Day + 1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate
/# ↓↓↓↓
获取当月月底当前时间#/DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
DateTime.Add DateTime:CurrentDateTime TimeToAdd:-CurrentDateTime.Day + 1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate
DateTime.Add DateTime:ResultedDate TimeToAdd:1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> ResultedDate2
DateTime.Add DateTime:ResultedDate2 TimeToAdd:-1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate3
/# ↓↓↓↓
获取本月1号0点-----case2#/DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
SET date TO $'''%CurrentDateTime.Year%/%CurrentDateTime.Month%/01'''
Text.ConvertTextToDateTime.ToDateTime Text: date DateTime=> TextAsDateTime
/# ↓↓↓↓
获取当月月底235959------#/DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
SET date TO $'''%CurrentDateTime.Year%/%CurrentDateTime.Month%/01'''
Text.ConvertTextToDateTime.ToDateTime Text: date DateTime=> TextAsDateTime
DateTime.Add DateTime:TextAsDateTime TimeToAdd:1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> ResultedDate
DateTime.Add DateTime:ResultedDate TimeToAdd:-1 TimeUnit: DateTime.TimeUnit.Seconds ResultedDate=> ResultedDate2
/# ↓↓↓↓
将数字日期更改为日期时间值#/
SET NumDate TO 20220601
Text.FromNumber Number:NumDate DecimalPlaces:0 UseThousandsSeparator: False FormattedNumber=> NumDateText
Text.ConvertTextToDateTime.ToDateTime Text: $'''%NumDateText[:4]%/%NumDateText[4:6]%/%NumDateText[6:]%''' DateTime=> TextAsDateTime
/# ↓↓↓↓
考虑周末的月末工作日#/DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
SET date TO $'''%CurrentDateTime.Year%/%CurrentDateTime.Month%/01'''
Text.ConvertTextToDateTime.ToDateTime Text: date DateTime=> TextAsDateTime
DateTime.Add DateTime:TextAsDateTime TimeToAdd:1 TimeUnit: DateTime.TimeUnit.Months ResultedDate=> ResultedDate
DateTime.Add DateTime:ResultedDate TimeToAdd:-1 TimeUnit: DateTime.TimeUnit.Seconds ResultedDate=> ResultedDate2
SET WeekofDay TO ResultedDate2.DayOfWeek
SWITCH WeekofDay
CASE = $'''Sunday'''
DateTime.Add DateTime:ResultedDate2 TimeToAdd:-2 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate3
CASE = $'''Saturday'''
DateTime.Add DateTime:ResultedDate2 TimeToAdd:-1 TimeUnit: DateTime.TimeUnit.Days ResultedDate=> ResultedDate3
DEFAULT
SET ResultedDate3 TO ResultedDate2
END
PAD变量(4)布尔类型
SET boolvar TO 3 = 3
SET boolvar2 TO 3 <> 4
DateTime.GetCurrentDateTime.Local DateTimeFormat: DateTime.DateTimeFormat.DateAndTime CurrentDateTime=> CurrentDateTime
SET datetime TO D'2021/02/25 00:00:00'
SET boolvar3 TO CurrentDateTime > datetime
SET Text TO $'''ABCDEFGH'''
SET boolvar4 TO Text.Length >= 6
SET boolvar5 TO Text[2] < 'D'
SET boolvar6 TO CurrentDateTime.DayOfWeek <= datetime.DayOfWeek
SET LogiVar TO 3 = 3 AND 2 = 1
SET LogiVar2 TO boolvar AND boolvar2
SET LogiVar3 TO 'D' <> 'D' OR 'E' < 'J'
SET LogiVar4 TO 4 > 3 XOR 6 < 5
SET LogiVar5 TO NOT 7 < 5
IF (CurrentDateTime.Day >= 15 AND (CurrentDateTime.Month = 2 OR CurrentDateTime.Month = 4) AND NOT CurrentDateTime.DayOfWeek = 'Sunday') = True THEN
Display.ShowMessageDialog.ShowMessage Title:$'''PA4d''' Message:$'''测试变量''' Icon:Display.Icon.None Buttons:Display.Buttons.OK DefaultButton:Display.DefaultButton.Button1 IsTopMost:False
END
SET IsDayGt15 TO CurrentDateTime.Day > 15
SET IsMonthAprOrFeb TO CurrentDateTime.Month = 2 OR CurrentDateTime.Month = 4
SET IsWeekOfDaySunday TO NOT CurrentDateTime.DayOfWeek = 'Sunday'
IF (IsDayGt15 AND IsMonthAprOrFeb AND IsWeekOfDaySunday) = True THEN
Display.ShowMessageDialog.ShowMessage Title:$'''PA4d''' Message:$'''测试变量''' Icon:Display.Icon.None Buttons:Display.Buttons.OK DefaultButton:Display.DefaultButton.Button1 IsTopMost:False
END
文章目录PAD变量(1)数字类型PAD变量(2)文本类型PAD变量(3)日期时间类型PAD变量(4)布尔类型PAD变量(1)数字类型SET num1 TO 1SET num2 TO 3.3SET sum TO $'''1 + 2'''SET sum2 TO num1 + num2SET sum3 TO $'''%num1%+%num2%'''SET Textnum TO $'''%'1'%'''SET dif TO 2 - 5SET dif2 TO 1 - difSET mul TO 5