Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 4th, 2005, 08:36 AM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to write a structure???

Hello

may i know how to write a structure in Visual Basic
please give me an example
 
Old July 4th, 2005, 11:09 PM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 221
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello

Here is the sample code

Declare in the General section of the form or in the
module.

Public Type struct_CustomerDetails
str_CustomerName as String
int_CustomerAge as Integer
str_CustomerAddress as String
str_CustomerEmail as String
End Type

and to use it in the code...

Dim stCD as struct_CustomerDetails

stCD.str_CustomerName = "Cust Name"
stCD.int_CustomerAge = 99
stCD.str_CustomerAddress = "Milkyway"
stCD.str_CustomerEmail = "[email protected]"

Msgbox stCD.str_CustomerName

You can use this structure as the way you want as you
use a varible and structure is user-defined varible.

Hope this helps and gives you some idea.

With Regards,
Raghavendra Mudugal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting Structure seananderson SQL Server 2005 2 September 4th, 2007 03:29 AM
Difference between Trace.write and Debug.write surendraparashar ASP.NET 2.0 Professional 1 June 27th, 2007 02:12 AM
frame structure crmpicco Javascript How-To 14 September 20th, 2006 06:03 PM
Database Structure aw23 VB Databases Basics 2 October 15th, 2005 01:20 PM
File to Structure? TheShadow C++ Programming 3 October 23rd, 2004 05:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.