Microsoft PowerApps
Microsoft PowerApps is a low-code platform created by Microsoft that allows developers to build custom business applications quickly and easily. Developers can use various connectors and data sources to create applications for various platforms such as mobile devices and web browsers. Here's an example of code in PowerApps to create a simple calculator:
ClearCollect(Numbers, {Number: "1"}, {Number: "2"}, {Number: "3"}, {Number: "4"}, {Number: "5"}, {Number: "6"}, {Number: "7"}, {Number: "8"}, {Number: "9"}, {Number: "0"})
ClearCollect(Operators, {Operator: "+"}, {Operator: "-"}, {Operator: "*"}, {Operator: "/"})
Set(CurrentNumber, "")
Set(CurrentOperator, "")
ForAll(Numbers, UpdateContext({CurrentNumber: CurrentNumber & ThisItem.Number}))
ForAll(Operators, UpdateContext({CurrentOperator: ThisItem.Operator}))
Switch(CurrentOperator, "+", Set(Result, Value(CurrentNumber) + Value(PreviousNumber)),
"-", Set(Result, Value(PreviousNumber) - Value(CurrentNumber)),
"*", Set(Result, Value(CurrentNumber) * Value(PreviousNumber)),
"/", Set(Result, Value(PreviousNumber) / Value(CurrentNumber)))
Set(PreviousNumber, CurrentNumber)
Set(CurrentNumber, "")
Set(CurrentOperator, "")
No comments:
Post a Comment