Re: Probably for David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Thanx Bernie, David and Robert, I'd forgot about sprint(). It's done the
trick.

For Robert,
The conversion I'd been using was

   sequence my_inf
   integer temp, string_address, ok

      my_inf = {2600, 1522, 5439872} -- values filled during runtime

      for i = length(my_inf) to 1 by -1 do
        temp = my_inf[i]
        if temp = 0 then
          my_string = "0" & my_string
        else
          while temp != 0 do
            my_string = ((((temp/10)-(floor(temp/10)))*10)+48) & my_string
            temp = floor(temp/10)
          end while
         end if
         my_string = " " & my_string
      end for

      string_address = allocate_string(my_string)
      ok = c_func(SetWindowText, {window_handle[5], string_address})


Now who would use anything as complicated as sprint(my_inf) when they could
do something as simple the above blink

Thanx again (I promise I'll check Library.Doc in future)

Terry


Robert wrote:

>I suspect that your conversion is producing results
>which are *very* slightly off in some cases. When you
>display the results in the trace window they are
>rounded (to 10 significant digits), so they look ok,
>but in reality they are not exact integers.
>Later they get rounded *down*. That's why you get
>digits that are 1 less than they should be in some cases.
>If you show us the code that you are using for the
>conversion maybe we can spot where the (slight) error
>is creeping in.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu