Re: Global Variable Dropping Leading Zeros

From: Andy Hardy <aph_at_ahardy.demon.co.uk>
Date: Mon, 14 Jun 1999 20:42:11 +0100
Message-ID: <p0zY$LATsVZ3Ew70_at_ahardy.demon.co.uk>


In article <7k37u7$rqr$1_at_nnrp1.deja.com>, webbde_at_post.queensu.ca writes
>Hi,
>
>I am using Forms 5. Can anyone help on this annoying little problem? Is
>there a way to prevent the leading zeros from being dropped in a global
>variable? For instance when I load department 002 into global.deptno I
>want it to equal 002, not 2.

[Quoted] Globals are char fields, you need to send the value you require to the global including the zeroes - e.g. global.deptno := '002'.

E.G the following works for me on a simple push-button action.

:global.value := '001';
:block2.display_item := :global.value;

Whilst this just counts up as numbers:

default_value('1','global.value');
:global.value := to_number(:global.value) + 1; :block2.display_item := :global.value;

Is the value you are passing numeric or char?

Andy
>
>Thanks,
>
>Dan Webb
>webbde_at_post.queensu.ca
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

-- 
Andy Hardy. PGP key available on request
===============================================================
Received on Mon Jun 14 1999 - 21:42:11 CEST

Original text of this message