4 Replies - 353 Views - Last Post: 31 January 2019 - 06:14 PM Rate Topic: -----

#1 knenok   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-January 19

pseudocode help - calling inputbox and CDbl

Posted 31 January 2019 - 01:32 PM

i need to call the procedure inputbox. looking at line 5 & 6 (below), the value on line 5 is a string so i need to call CDbl as well, but i'm not sure where to put it or how to state it in the pcode...

i have:

  • declare the object named 1 using the double type
  • declare the object named 2 using the double type
  • declare the object named 3 using the double type
  • declare the object named 4 using the double type
  • call the procedure named inputbox sending the value x and the value y
  • assign the value on line 5 to the object named 1
  • call the procedure named inputbox sending the value x and the value y
  • assign the value on line 7 to the object named 2
  • call the procedure named inputbox sending the value x and the value y
  • assign the value on line 9 to the object named 3
  • call the procedure named inputbox sending the value x and the value y
  • assign the value on line 11 to the object named 4
  • ...etc (rest of pcode)


Is This A Good Question/Topic? 0
  • +

Replies To: pseudocode help - calling inputbox and CDbl

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14854
  • View blog
  • Posts: 59,272
  • Joined: 12-June 08

Re: pseudocode help - calling inputbox and CDbl

Posted 31 January 2019 - 01:49 PM

Why not just say 'cast' in there?


Quote

assign the value on line 5 to the object named 1

assign the cast-as-double value on line 5 to the object named 1

Was This Post Helpful? 0
  • +
  • -

#3 knenok   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-January 19

Re: pseudocode help - calling inputbox and CDbl

Posted 31 January 2019 - 04:36 PM

so could that go after each 'assign the value on line ___ to the object named ___' or would it only need to be in there once for it to be recognized?

if the vb code was
1 = (CDbl(InputBox("x", "y")))

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14854
  • View blog
  • Posts: 59,272
  • Joined: 12-June 08

Re: pseudocode help - calling inputbox and CDbl

Posted 31 January 2019 - 06:00 PM

Just say 'Convert value to X'
Was This Post Helpful? 0
  • +
  • -

#5 Sheepings   User is offline

  • Senior Programmer
  • member icon

Reputation: 201
  • View blog
  • Posts: 1,125
  • Joined: 05-December 13

Re: pseudocode help - calling inputbox and CDbl

Posted 31 January 2019 - 06:14 PM

Don't let your IDE decide what is "best" to convert your value types for you. You decide; and to that its important to know what the values of x, y are? And if you're sure of conversion type, you can find the docs on what is being recommended above here :: https://docs.microso...framework-4.7.2

Edit - post the code you have.

This post has been edited by Sheepings: 31 January 2019 - 08:13 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1