Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Newbie Questions


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-05-2008, 07:26 PM
Junior Member
 
Join Date: Apr 2008
Location: FRANCE
Posts: 13
Default Newbie Questions

Hi there,

Two little questions:

How to dispaly (using 'Format')
1.2345678 like this 001.123
something like Format(1.23456,"D3F3") ?

and then

Dim Type (name,age) person
Dim Type (name,age) other_person

How to copy directly person => other_person

whithout made:
other_person.name=person.name
other_person.age=person.age

Many thanks !!!!!
Bruno.
Reply With Quote
  #2 (permalink)  
Old 05-05-2008, 07:39 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,335
Default

You can copy the struct with ArrayCopy:
Code:
ArrayCopy(person(),0,2,other_Person(),0)
Format:
You will need to treat differently the whole part and the fraction part.
Code:
Sub App_Start
    Msgbox(SpecialFormat(1.2345678)) 'will display 001.235
End Sub

Sub SpecialFormat(num)
    frac = Format(num - Int(num),"F3")
    Return Format(Int(num),"d3") & SubString(frac,1,StrLength(frac)-1)
End Sub
Reply With Quote
  #3 (permalink)  
Old 05-05-2008, 07:45 PM
Junior Member
 
Join Date: Apr 2008
Location: FRANCE
Posts: 13
Default

Thanks Erel,

PS: Very useful Basic4PPC !!!!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A few questions regarding FormLib N1c0_ds Questions & Help Needed 6 09-19-2008 03:34 AM
More SQL questions HARRY Questions & Help Needed 2 01-04-2008 11:15 AM
SQL Questions tcgoh Questions & Help Needed 7 12-31-2007 10:10 AM
Newbie questions stratus Questions & Help Needed 2 11-13-2007 02:21 PM
2 questions about Outlook Alex812 Questions & Help Needed 1 08-27-2007 07:54 PM


All times are GMT. The time now is 05:54 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0