Hi friends,
What BB can be used to load text files (.txt) to studio. Can we use "Load Asset BB" or any other?
thanks
jeeva
Hi friends,
What BB can be used to load text files (.txt) to studio. Can we use "Load Asset BB" or any other?
thanks
jeeva
Hi,
Yes you can, it's basically the same thing than for any other external file, except this time you need to cast the vkTextResource into a vkString.
thank you hiddentux for your valuable share
Hi Jeeva,
vkURI path;
path.Create("Plelase specify the text file path here");
vkAssetPtr asset;
vkArray<vkResourcePtr> res;
vkString content,subStr;
err = GetStage().LoadAsset(path,res,&asset,true,true);
if(err==errOk)
{
vkString delimeter[3];
delimeter[0] = "\r\n";
delimeter[1] = "\r";
delimeter[2] = "\n";
vkTextResourcePtr text = res[0];
Print(text.m_Text.Length());
content = text.m_Text;
Print("------- CONTENT OF THE TEXT ---------");
vkString::Iterator itStart = content.Begin();
vkString::Iterator it = content.Find('\n');
while(it!=content.End())
{
vkString out = content.SubString(itStart,it);
itStart = it++;
it = content.Find('\n',itStart);
Print(out);
}
Try to implement this code.
You can have a look at this sample too: http://www.3dvia.com/content/91C86E8799ABBD8F/load-local-text-file
You must log in to post.