You are not logged in.

woz

Beginner

  • "woz" started this thread

Posts: 7

Date of registration: Oct 11th 2012

  • Send private message

1

Thursday, October 11th 2012, 4:54pm

noobie with Jabaco

I have a .vbs file that I want to convert to an Android app.
Jabaco can create the vb to jar file, then I can use "phonegap" to compile all files + jar to android.

My problem is that
1> Total novice with Jabaco
2> Im using elements such as DateDiff, Inputboxes, Log (natural logarithm) & Exp (exponential)...Im not sure allof these are covered with Jabaco.
3> I can see a few threads referring to datediff...but dont have a clue...what im supposed to do!
4> Ive seen a thread referring to inputboxes & the java equivelant
5> I cant find anything for Log (natural logarithm) & Exp (exponential)...in case thats a problem further on.

I've installed the Jabaco 1.5.2 & added my VB code & im erroring on the datediff ("d"..... parameter.

Does anyone have a simple single module that uses such parameters that could share with me how they got it all working?!...or assist with some hand-holding?!
Appreciate any help you can offer ;-)

Wºz™

woz

Beginner

  • "woz" started this thread

Posts: 7

Date of registration: Oct 11th 2012

  • Send private message

2

Thursday, October 11th 2012, 5:39pm

OK, now sussed out that thanks fo a thread on here the 1.5.2 doesnt ship with the latest framework....<sigh>. That seems to have resolved the datediff issue.
I can at least run the app...but it doesnt launch....so I guess theres more to do...
I have the message "Listening for transport dt_shmem at address: Jabaco26252924x828" sitting at the bottom of the screen & nothing else happens?!
....would it be bacuse im not using any forms etc but just using inputboxes but Im not calling them correctly or I need to do something further?

<please excuse any typos...have trapped nerve in arm....hurts to type>
Wºz™
Thnaks to Dani...for posting this whilst digging around the forums...
"http://www.jabaco.org/board/p3044-comman…r.html#post3044

is pointing to thelatest version. "

"
"

"

Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

3

Friday, October 12th 2012, 9:23am

Hey there,

ok lets see if I am getting this right?!
You want to calculate something without using any form object?

-> start a new Jabaco project
-> remove Form1
-> modify Module1

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
'Public Form1 As New Form1

Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   
   MsgBox(Exp(InputBox("base:")))

'   Form1.SetDefaultClose()
'   Form1.Show()
End Sub


What are you planning to do with the output?
Save it to a file? There are samples in the forum...


Dani

woz

Beginner

  • "woz" started this thread

Posts: 7

Date of registration: Oct 11th 2012

  • Send private message

4

Friday, October 12th 2012, 11:46am

Hi Dani, you seem to be quite an active member on these boards, so I appreciate the time to respond.
Im unable to share the code in full due to the nature of my business but I`ll try my best to explain.
I have 4 inputboxes that are requiring dates
ie:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Sub sample()
bullet = Chr(10) & "   " & Chr(149) & " " 
Do
response = InputBox("Please enter the gender:" & Chr(10) & bullet & "1.) Male" & bullet & "2.) Female", "Select gender")      
 If response = "" Then 
 WScript.Quit
  Else  
      If IsNumeric(response) Then 
  Exit do
   Else
  MsgBox "You must enter a numeric value.", 48, "Invalid Entry"  
  End if
 End if  
loopEnd Sub 

Note: my current file is just a .vbs file in a Win OS. hence Wscript references.
... the value "response" is stored & used later in a select case statement.
The other inputboxes are setup in a similar way in that dates are required for when something has happened & calculations are done based upon the length of time between the dates, hence the datediff function.Theres lots of calculations done on dates vs age, vs gender; based upon a few other selections made from other inputboxes that are written similar to the above code for categories etc.
All of these values are crunched & a msgbox displays at the end with the calculated values. These values are used as a guide to what actions need to be taken...so they do not need to be stored...just displayed.
I really apologise that this may all seem a bit ambiguous, which makes things tougher buty i really appreciate the efforts ;)
Wºz™

This post has been edited 1 times, last edit by "woz" (Oct 12th 2012, 11:51am)


Dani

Intermediate

Posts: 325

Date of registration: Nov 19th 2009

Location: GERMANY

  • Send private message

5

Friday, October 12th 2012, 12:50pm

Hey there,

OK ... I got all that!
But where are you stuck right now?
My little snippet shows you how to invoke the Input- and MsgBox.
Just make sure when starting your app that 'Sub main' calls your first InputBox and handle the response from there...

Jabaco Source

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'Public Form1 As New Form1

Public Sub main(ByJava args() As String)
   Dim myArgs() As String
   myArgs = args
   
   sample()

'   Form1.SetDefaultClose()
'   Form1.Show()
End Sub

Public Sub sample()
   MsgBox(Exp(InputBox("Exp:")))
   log1Enter:
   Dim log1 As String = InputBox("log:")
   If IsNumeric(log1)= False Then MsgBox("please enter a number!") : Goto log1Enter
   baseEnter:
   Dim base As String = InputBox("base:")
   If IsNumeric(base)= False Then MsgBox("please enter a number!") : Goto baseEnter
   MsgBox(Log(CDbl(log1))/CDbl(base))
End Sub


Dani

This post has been edited 2 times, last edit by "Dani" (Oct 12th 2012, 2:14pm)


woz

Beginner

  • "woz" started this thread

Posts: 7

Date of registration: Oct 11th 2012

  • Send private message

6

Friday, October 12th 2012, 3:27pm

Big thanks Dani, that should be enough for me to resolve. Really appreciate the help ;)
"....someone buy that man a beer!"
Wºz™

Rate this thread
WoltLab Burning Board