Reading Big Text
Troubles_In_Paradise
Member Posts: 588
Hi everybody!
I need a little help!
I've a BigText variable that contains the value of a BLOB field.
I need to bring the first 1024 characters and put them into the first element of an array.
I tried with the COPYSTR Function but I knew that it won't work because BigText doesn't support classic text function.
I need a little help!
I've a BigText variable that contains the value of a BLOB field.
I need to bring the first 1024 characters and put them into the first element of an array.
I tried with the COPYSTR Function but I knew that it won't work because BigText doesn't support classic text function.
RecordVar.BlobField.createinstream(VarInstream); BigTextVar.read(VarInstream); VarArray[1] := CopySTR(BigTextVar,0,1024);So I'm wondering if there's another way...
~Rik~
It works as expected... More or Less...
It works as expected... More or Less...
0
Answers
-
As seen in the online help:
GETSUBTEXT
Use this function to retrieve part of a BigText variable.
[RetLength] := BigText.GETSUBTEXT(Variable, Position [,Length])0 -
SNielsen wrote:As seen in the online help:
GETSUBTEXT
Use this function to retrieve part of a BigText variable.
[RetLength] := BigText.GETSUBTEXT(Variable, Position [,Length])
I'd already tried with this function but i didn't understand how to avoid the error that it shows: "You can't open an empty BLOB"IF VarRecord.BlobField.HASVALUE THEN BEGIN VarRecord.BlobField.CREATEINSTREAM(ISInstream); VarBigText.READ(ISInstream); VarBigText.GETSUBTEXT(TXTArray[1],0,1024); END;
~Rik~
It works as expected... More or Less...0 -
I still post my attempts with hope that someone could help me...
VarBigText.ADDTEXT(VarRecord.BLOBField); VarBigText.GETSUBTEXT(TXTArray[1],1,1024);
and i put TXTarray[1] as SourceExpr a textbox in the report. with this method it prints only ' * '~Rik~
It works as expected... More or Less...0 -
Solved!
Thanks all!~Rik~
It works as expected... More or Less...0 -
Well done for solving it.
Would you like to consider posting how you solved it?0 -
here is the method I used to solve my problem...
I := 0; Len := 0; CLEAR(VaInstream); VarText := ''; REPEAT I := I + 1; Array[I] := ''; UNTIL I = 10; VarRecord.CALCFIELDS(Blob Field); IF VarRecord.BlobField.HASVALUE THEN BEGIN VarRecord.BlobField.CREATEINSTREAM(VarInstream); I := 1; WHILE NOT (VarInstream.EOS()) AND (I < 10) DO BEGIN Len := STRLEN(Array[I]); IF (len >= 1024) OR ((len + 50) >= 1024) THEN BEGIN I := I +1; VarInstream.READTEXT(VarText); Array[I] := Array[I] + VarText + ' '; END ELSE BEGIN VarText := ''; VarText := Array[I]; VarInstream.READTEXT(Array[I], 50); Array[I] := VarText +' '+ Array[I]; VarText := ''; END; END; IF I >= 10 THEN ERROR('Description too large Contact the programmer.); END;
in this way i put all the blob in an array. in each element there's 1024 characters of the blob. the array has got 10 elements so user can write 10240 characters. if you need for more characters you can set dimensions of the array to a larger number.
I hope that this topic could be usefull.
regards!~Rik~
It works as expected... More or Less...0 -
thank you very much for this post, it also helped me with a problem i have been sitting with for months!!
you have made my day.0 -
That's a brilliant solution - thanks for posting this!0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions