472,374 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

Create variable longer than 255 characters

83
I would like to create a text variable that has 255 characters. If it isn't posssible what other options do I have?
Apr 9 '07 #1
8 11392
ADezii
8,832 Expert 8TB
I would like to create a text variable that has 255 characters. If it isn't posssible what other options do I have?
It is possible and what it is called is declaring a Variable as a Fixed Length String. Whatever spaces are not used within the Variable are padded:
Expand|Select|Wrap|Line Numbers
  1. Dim strYourVariable As String * 255
  2. strYourVariable = "Philadelphia"
'Philadelphia consists of 12 Bytes while strYourVariable consist of 255 Bytes
'(12 for Philadelphia and 243 'padded spaces')

Expand|Select|Wrap|Line Numbers
  1. Debug.Print Len(strYourVariable)      'will output 255
NOTE: A Fixed Length String can contain 1 to approximately 64K (2^16) characters.
Apr 9 '07 #2
Hi,

If you want to create text variable more than 255 characters then use memo instead of text it has 65535

try this option it might work

thanks & bye

kartik
Apr 10 '07 #3
missinglinq
3,532 Expert 2GB
And exactly how would you Dim that variable, kartik?
Apr 10 '07 #4
ADezii
8,832 Expert 8TB
Hi,

If you want to create text variable more than 255 characters then use memo instead of text it has 65535

try this option it might work

thanks & bye

kartik
You cannot Declare a Variable as Type Memo - no such animal exists.
Apr 10 '07 #5
jl2886
83
Thanks everyone, I just seperated the variable into a couple different ones.
Apr 10 '07 #6
ADezii
8,832 Expert 8TB
Thanks everyone, I just seperated the variable into a couple different ones.
Glad to help.
Apr 10 '07 #7
And exactly how would you Dim that variable, kartik?
You don't require dim option here. no coding required.

simply create a table you need create field name next to field go to data type and select memo instead of text

Thanks & Bye

Kartik
Apr 13 '07 #8
Rabbit
12,516 Expert Mod 8TB
You don't require dim option here. no coding required.

simply create a table you need create field name next to field go to data type and select memo instead of text

Thanks & Bye

Kartik
You misunderstood what missinglinq was talking about. A variable is not the same thing as a field.

A variable is Dimmed through code and as such there is no Memo variable.
Apr 13 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

18
by: Carramba | last post by:
Hi! I am wondering what is the best way to control that compiler manage variable names longer then 8 signs. Does it enought to set 2 variables with the same name and difference after 8 sign and...
1
by: IC | last post by:
Hello, When debugging a SQL sproc in VS.NET, is there a way to get the debugger to retrieve the full value of a SQL variable if its content is longer than 256 characters? I currently have a...
3
by: Zenu | last post by:
Hi, I have a system with very long paths and I'm trying to use file.exist(Longpath) to test the paths existance but it gives a message that the path is too long. Can someone tell me how to...
16
by: John | last post by:
Does the length of my C variable names have any affect, performance-wise, on my final executable program? I mean, once compiled, etc., is there any difference between these two: number = 3; n =...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.