Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: separated number Post Reply Post New Topic
Author Message
joekanant@gmail
Newbie
Newbie
Avatar

Joined: 07 Nov 2018
Online Status: Offline
Posts: 8
Quote joekanant@gmail Replybullet Topic: separated number
    Posted: 06 Dec 2018 at 3:18am
Hi,
I need to make a number into some variable. for example : 1234
I need to make it into :
var1=1
var2=2
var3=3
var4=4

Does anyone have a solution?

thx,

Joe
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Dec 2018 at 4:53am
It could be interesting.  I would assume that the number is always the same length.  Thus you could change the number to a string, use string functions to break up the number then covert it back to number.

I.e.,
local stringvar tempvar;
local numbervar var1;
local numbervar var2;
local numbervar var3;
local numbervar var4;
tempvar := cstr({somefield});
var1 := cdbl(left(tempvar,1));
var2 := cdbl(mid(tempvar,2,1));
var3 :+ cdbl(mid(tempvar,3,1));
var4 := cdbl(right(tempvar,1));


IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.