PAD变量

PAD变量(1)数字类型

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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值