Тёмный

Creating a Calculator from Scratch in a PowerApps Example 

Andrew Hess
Подписаться 9 тыс.
Просмотров 11 тыс.
50% 1

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 62   
@andrewhess123
@andrewhess123 Год назад
Since the video was created, there was an error on the Equal Sign Button, here is the equation that works: UpdateContext({varCalculate: varCalculate & varNumber}); Switch( varCalcType, "Plus", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) + Value(lblNumber.Text))}), "Subtract", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) - Value(lblNumber.Text))}), "Multiply", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) * Value(lblNumber.Text))}), "Divide", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) / Value(lblNumber.Text))}) ); UpdateContext({varToggle: true});
@AltafKhan-mm4sz
@AltafKhan-mm4sz Год назад
Error showing again
@andrewhess123
@andrewhess123 Год назад
@@AltafKhan-mm4sz I tested it, have it working right now. Here is the equation I used. The only issue was the 2nd number was not using the Length and trying to calculate "5 +" it needed to remove the space and the " +" symbol. UpdateContext({varCalculate: varCalculate & varNumber}); Switch( varCalcType, "Plus", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) + Value(lblNumber.Text))}), "Subtract", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) - Value(lblNumber.Text))}), "Multiply", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) * Value(lblNumber.Text))}), "Divide", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) / Value(lblNumber.Text))}) ); UpdateContext({varToggle: true});
@AltafKhan-mm4sz
@AltafKhan-mm4sz Год назад
@@andrewhess123 thanks, error solved.
@MartinaPokorna-b3r
@MartinaPokorna-b3r 5 месяцев назад
Please how to fix it? It is my first app and do not know what and where. Thank you :)
@andrewhess123
@andrewhess123 5 месяцев назад
@@MartinaPokorna-b3r So, I believe you put that equation in the OnSelect property of the Equal Sign Button
@topinfo_ng
@topinfo_ng 6 месяцев назад
Every beginner needs to watch this video. Thank you
@andrewhess123
@andrewhess123 6 месяцев назад
Thank you Bajio!
@kingsleyudeagha
@kingsleyudeagha 2 года назад
My first fun project when I just started out. Thank you Andrew.
@andrewhess123
@andrewhess123 2 года назад
Awesome, did you do it a different way?
@kingsleyudeagha
@kingsleyudeagha 2 года назад
So in mine, I stored the first and second arguments in separate variables. I like the approach with len, very nice.
@andrewhess123
@andrewhess123 2 года назад
@@kingsleyudeagha Looks really good! Very Impressive! Love it!
@andrewhess123
@andrewhess123 2 года назад
@@kingsleyudeagha Thanks for sharing!
@andrewhess123
@andrewhess123 2 года назад
The formulas are in the description of the video. This calculator was actually a good learning experiment. Thank you for watching!
@De_Wezel
@De_Wezel Месяц назад
Something that would be fun for a potential part 2. In the windows calculator, if you say add 5 to 6, it returns 11. But when you press equals again, it takes that 11 and applies the last operation (the +6) to that, so you can keep looping over 1 operation in a way. I, ofr one, would be curious how you would achieve that effect in this calculator build
@andrewhess123
@andrewhess123 Месяц назад
That's a good question. There probably would need to be some sort of variable that changes true/false depending on if you hit another "number" button or not. If you don't hit a new "number" button it just does the previous calculation.
@esezoressafwat6400
@esezoressafwat6400 Год назад
Hello Andrew, Frist ,Thank you for this video second , when i add two or more digits like (12 + 24)... i get a " the value 12 + cannot be converted to a number" can yo help me to solve this error ?
@andrewhess123
@andrewhess123 Год назад
UpdateContext({varCalculate: varCalculate & varNumber}); Switch( varCalcType, "Plus", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) + Value(lblNumber.Text))}), "Subtract", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) - Value(lblNumber.Text))}), "Multiply", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) * Value(lblNumber.Text))}), "Divide", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) / Value(lblNumber.Text))}) ); UpdateContext({varToggle: true});
@andrewhess123
@andrewhess123 Год назад
Needed to fix the equal equation
@sheikfareedh9500
@sheikfareedh9500 Месяц назад
By any chance this calculator takes the input from keyboard? Like if we select 1 in key board 1 will be selected in screen
@andrewhess123
@andrewhess123 Месяц назад
Another awesome question. I think it could be possible but no it's not set up that way yet.
@sheikfareedh9500
@sheikfareedh9500 Месяц назад
@@andrewhess123 Thanks for your replay. I don't think so powerapps can analyse the key stroke from key board.. Can you please check once
@gurupritsingh3991
@gurupritsingh3991 8 месяцев назад
Wonderfully explained
@andrewhess123
@andrewhess123 8 месяцев назад
Thank Gurpreet, there's a couple errors still but hopefully it get's a lot of the beginning steps fixed 😀
@staralfa5959
@staralfa5959 Год назад
Hi Andrew, i get an error when i add two or more digits (2 + 22)... i get a " the value 2 + cannot be converted to a number"
@esezoressafwat6400
@esezoressafwat6400 Год назад
the same error
@andrewhess123
@andrewhess123 Год назад
Here's a fix on the Equal Sign Formula UpdateContext({varCalculate: varCalculate & varNumber}); Switch( varCalcType, "Plus", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) + Value(lblNumber.Text))}), "Subtract", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) - Value(lblNumber.Text))}), "Multiply", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) * Value(lblNumber.Text))}), "Divide", UpdateContext({varNumber: Text(Left(lblCalculate.Text,Len(lblCalculate.Text) - (Len(varNumber)+3)) / Value(lblNumber.Text))}) ); UpdateContext({varToggle: true});
@riteshdhanotiya9870
@riteshdhanotiya9870 4 месяца назад
@staralfa5959 you error is solved or not? because i face same problrm and i cant solve it. pls help me .
@ronbakker1300
@ronbakker1300 Год назад
Hi Andrew, thank you for this video,7:21 On the numbers I used UpdateContext({varNumbers: varNum & Self.Text}). 10:46 I used a collection for the top label that shows the equation. But I don't think I could of worked it out before watching your video first.
@andrewhess123
@andrewhess123 Год назад
Thank you for watching Ron, awesome to know that this video helped.
@kingsleyudeagha
@kingsleyudeagha 2 года назад
This is great, thank you for this.
@fabioluiz827
@fabioluiz827 Год назад
Muito obrigado amigo, me salvou!!
@andrewhess123
@andrewhess123 Год назад
Obrigado por assistir!!
@AlexandrePerret
@AlexandrePerret 2 года назад
To correct the 0 starting numbers, just display the numbers using Value(...) function
@andrewhess123
@andrewhess123 2 года назад
Thanks, good idea! Duh, I should of known that! haha That would fix it too. Thanks Alexandre!
@MartinaPokorna-b3r
@MartinaPokorna-b3r 5 месяцев назад
Would you be so kind and could you write here how it will be? I am a beginer so it would realy help. Tank you
@rutujamogal7564
@rutujamogal7564 Год назад
I am getting an error on clear button what should I do
@andrewhess123
@andrewhess123 Год назад
What's the error? If you hover over, it can help you resolve the issue?
@hellobabu1
@hellobabu1 Год назад
no zero button?
@andrewhess123
@andrewhess123 Год назад
Good Point 😁 Yeah I was just seeing how fast I could create one, not that anyone should copy the exact example. There's def some things that could be done to fix the app to perfection.
@victorionescu7653
@victorionescu7653 2 года назад
The difference between low-code programming and real programming. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-sBJmRD7kNTk.html Why reinvent the wheel? We have to focus on the algorithms and creation part.
@andrewhess123
@andrewhess123 2 года назад
Thanks for sharing Victor, You can always do the "real" coding part in Power Apps too, just use Power Apps Framework: learn.microsoft.com/en-us/power-apps/developer/component-framework/overview
Далее
СОБАКА И  ТРИ ТАБАЛАПКИ Ч.2 #shorts
00:33
The Variable HACK 🔨 Not many Scratchers know... yet
10:33
Power Apps Collections Introduction
18:48
Просмотров 90 тыс.
Data Analysis with Python for Excel Users - Full Course
3:57:46
СОБАКА И  ТРИ ТАБАЛАПКИ Ч.2 #shorts
00:33