Author |
Topic: Trafo Calc (Read 119 times) |
|
teslaBPL
BPL Expert
    
member is offline

Author of Aurel Basic

Gender: 
Posts: 261
|
 |
Trafo Calc
« Thread started on: Mar 8th, 2009, 12:01pm » |
|
Hi... Here is very quiet.So i decide break the silence. I want convert one my program from ABasic to BPL. Here is code:
Code:' //////// start program - Trafo calc /////////////
' declare variables
'///////////////////////////////////////////////////////////
declare u1$
""
declare u2$
""
declare l$
""
declare n1
"0"
declare n2
"0"
declare p
"0"
declare sp
"0"
'///////////////////////////////////////////////////////
Background() "buttonface"
Windowsize = 400 300
' < controls >
Boundbox "Input values" 10 10 370 100
Statictext "Primary Voltage Secondary Voltage Trafo Power" 20 40 300 18
Textbox @tb1 20 60 60 22
Textbox @tb2 120 60 60 22
Textbox @tb3 230 60 60 22
Textbox @tb4 240 120 100 22
Textbox @tb5 240 150 100 22
Button "CALCULATE" {calc1} 10 120 100 30
'//////////////////////////////////////////////////////
Window() "Trafo Calc"
'//////////////////////////////////////////////////////
stop
{calc1}
textboxcontents @tb1 u1$
textboxcontents @tb2 u2$
maths
l$ = u1$ + u2$
Aboutbox l$
' something like put text in @tb3 as l$
stop
textboxcontents @tb1 address$"
Like you see i find problem. How I can set new text (in this case number) to textbox @tb3. I read complet manual and I dont find any command which can do this? Maby I miss something? all best zlatko
|
|
Logged
|
http://aurelw.wiz.googlepages.com/aurelsoft http://aurelbasic.smfnew.com
|
|
|
Admin
Administrator
    
member is offline


Gender: 
Posts: 1961
|
 |
Re: Trafo Calc
« Reply #1 on: Mar 8th, 2009, 12:53pm » |
|
Yep your right the forum has been quite quiet, although behind the scenes there has been quite a lot going on. Thomas and I have got a lot of work done on BPL V1.3, at the minute we are trying to get a good project management system working, but so far there are very few things we have managed to over come.
Code works great, except for the printing to the textbox, which somehow i have forgot to add a command for. This will be added in V1.3 for you. And I was wondering if you would allow me to consider using this as an example with BPL V1.3?
|
|
Logged
|
BPL - The legendary programming language created by Ashley & Tom ! ! !
|
|
|
teslaBPL
BPL Expert
    
member is offline

Author of Aurel Basic

Gender: 
Posts: 261
|
 |
Re: Trafo Calc
« Reply #2 on: Mar 8th, 2009, 2:22pm » |
|
Of course just add example in next release. And add command for seting text in textbox. You are like me , i forgot add combobox control in current release of ABasic(oh my!). And one more suggestion : Static control is only one as i see now. Do you can add something like you make with @tb1 Something Like: Statictext @st1 x y w h then for example Setstatictext @st1 "Text" Or something similiar. I think that would be ok. Whitout this commands I can't finish program. bye Zlatko
|
|
Logged
|
http://aurelw.wiz.googlepages.com/aurelsoft http://aurelbasic.smfnew.com
|
|
|
Admin
Administrator
    
member is offline


Gender: 
Posts: 1961
|
 |
Re: Trafo Calc
« Reply #3 on: Mar 8th, 2009, 2:30pm » |
|
Ok, thanks for the suggestions, I will do my best to add it
|
|
Logged
|
BPL - The legendary programming language created by Ashley & Tom ! ! !
|
|
|
Admin
Administrator
    
member is offline


Gender: 
Posts: 1961
|
 |
Re: Trafo Calc
« Reply #5 on: Apr 2nd, 2009, 4:43pm » |
|
Hi,
Yes I have planned to add your suggestion, I feel it is a very important thing to have in BPL, myself and Tom are working on both BPL and FB at the minute so we are busy, I havent got round to adding it yet, however I have been planning what commands I will add to allow manipulation of static text controls and how I will do them, adding handles are not easy and require a lot of code!
So look out for it in BPL 2009. V1.2 will have no more updates, BPL 2009 will be the next big update.... Coming soon(ish lol)!!
|
|
Logged
|
BPL - The legendary programming language created by Ashley & Tom ! ! !
|
|
|
teslaBPL
BPL Expert
    
member is offline

Author of Aurel Basic

Gender: 
Posts: 261
|
 |
Re: Trafo Calc
« Reply #6 on: Apr 2nd, 2009, 7:18pm » |
|
manipulation of static text controls and how I will do them, adding handles are not easy and require a lot of code!
I dont understand that is so tuff do this in LB in CB is almost piece of cacke?(Yeah i know LB is sometimes problematic"
So just work ,will be.... Zlatko
|
|
Logged
|
http://aurelw.wiz.googlepages.com/aurelsoft http://aurelbasic.smfnew.com
|
|
|
Admin
Administrator
    
member is offline


Gender: 
Posts: 1961
|
 |
Re: Trafo Calc
« Reply #7 on: Apr 2nd, 2009, 8:31pm » |
|
I can manage it, no problem. It just takes a lot of code, and is very repetitive. Like you say, LB doesnt make these things easy.
But it will be worth it, and they will be in BPL 2009.
|
|
Logged
|
BPL - The legendary programming language created by Ashley & Tom ! ! !
|
|
|
teslaBPL
BPL Expert
    
member is offline

Author of Aurel Basic

Gender: 
Posts: 261
|
 |
Re: Trafo Calc
« Reply #8 on: May 17th, 2009, 8:50pm » |
|
I try change content of textbox 4 with new result with command TEXTBOXPRINT but without sucsses. see code: Code:{calc1}
textboxcontents @tb1 u1$
textboxcontents @tb2 u2$
maths
l$ = u1$ + u2$
'Aboutbox l$
textboxprint @tb4 I$
' something like put text in @tb4 as l$
stop
textboxcontents @tb4 I$ What I do wrong , or this command is not implemented yet?
|
|
Logged
|
http://aurelw.wiz.googlepages.com/aurelsoft http://aurelbasic.smfnew.com
|
|
|
Admin
Administrator
    
member is offline


Gender: 
Posts: 1961
|
 |
Re: Trafo Calc
« Reply #9 on: May 17th, 2009, 9:12pm » |
|
Change it to this:
Code:{calc1}
textboxcontents @tb1 u1$
textboxcontents @tb2 u2$
maths
i$ = u1$ + u2$
textboxprint @tb4 i$
stop
The variables were different, that was your problem :)
|
| « Last Edit: May 17th, 2009, 9:19pm by Admin » |
Logged
|
BPL - The legendary programming language created by Ashley & Tom ! ! !
|
|
|
teslaBPL
BPL Expert
    
member is offline

Author of Aurel Basic

Gender: 
Posts: 261
|
 |
Re: Trafo Calc
« Reply #10 on: May 17th, 2009, 10:25pm » |
|
Great , work now. I use same variable but in upper case , so i change variable name to lower case an work ok. OK i will continue...
PS.This shape ( i call them string numbers ) is little bit tricky.
|
| « Last Edit: May 17th, 2009, 10:28pm by teslaBPL » |
Logged
|
http://aurelw.wiz.googlepages.com/aurelsoft http://aurelbasic.smfnew.com
|
|
|
|