Error need help CHUNK?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Error need help CHUNK?

Post by blairetabay » Thu Feb 27, 2014 8:50 am

error

button "btnPrint": execution error at line 35 (Chunk: no such object) near "txt_id", char 4

what does it mean?

Code: Select all


put fld "txt_id" into sample["sample2"]

is there something wrong with my code?

blaireTabay

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Error need help CHUNK?

Post by Simon » Thu Feb 27, 2014 9:02 am

Hi blaireTabay,
You should really go over the lessons here:
http://lessons.runrev.com/

Look up the property "text" in the dictionary.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Re: Error need help CHUNK?

Post by blairetabay » Thu Feb 27, 2014 9:24 am

this is my code that i get an error of a chunk. am i doing the right code?

Code: Select all


local sCurrentRecord
local  sLastRecord, sample
 local tLayoutFile, tDataBroker, tShowPreview

on mouseUp
    put 1 into sCurrentRecord
   
      if "qrtReportsLib" is not among the lines of the stacksInUse then
         start using stack "qrtReportsLib"
      end if
   
     
      put AbsolutePath ("tabaySample.qrl") into tLayoutFile
      put the long ID of me into tDataBroker
      put true into tShowPreview
   
     qrtReports_PrintReport tLayoutFile, tDataBroker, tShowPreview
   MyPrintReport
   
end mouseUp


on MyPrintReport tShowPreview
   
   put 1 into sCurrentRecord

#the error point here at this line this is the same way putting up a value. 

   put fld "txt_f" into sample["sample2"]
   put fld "txt_f" into sample["sample3"]
   put fld "txt_f" into sample["sample4"]
   
  end MyPrintReport

--on MyPrepNextDetail


--end MyPrepNextDetail


function qrtReports_endOfReport
  -- we've reached the end if we've passed our last record
  return (sCurrentRecord > sLastRecord)
end qrtReports_endOfReport
    
on qrtReports_moveNextRecord
  -- update our sCurrentRecord local variable
  add 1 to sCurrentRecord
  -- and fill up the detail data
  #MyPrepNextDetail
end qrtReports_moveNextRecord


function qrtReports_valueOfExpression pExpression
  -- this function will evaluate an expression and return the result
  put pExpression into tExpression
  replace "<QUOTE_REPLACEMENT>" with quote in tExpression
  return value(tExpression)
end qrtReports_valueOfExpression

function AbsolutePath pRelativePath
  ## this helper function looks for files from the directory where the stack is saved
  put the effective filename of this stack into tAbsolutePath
  set the itemDelimiter to "/"
  put pRelativePath into item -1 of tAbsolutePath
  return tAbsolutePath
end AbsolutePath


Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Error need help CHUNK?

Post by Simon » Thu Feb 27, 2014 9:35 am

Do you have a field named "txt_id"? or txt_f
Which one?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

blairetabay
Posts: 34
Joined: Mon Feb 24, 2014 10:12 am

Re: Error need help CHUNK?

Post by blairetabay » Thu Feb 27, 2014 10:02 am

Simon,


I have those field in my card.

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Contact:

Re: Error need help CHUNK?

Post by splash21 » Thu Feb 27, 2014 11:39 am

blairetabay wrote: button "btnPrint": execution error at line 35 (Chunk: no such object) near "txt_id", char 4

what does it mean?
Hi, blairetabay. It means that there's no field called "txt_id". If the field is on another card or something similar and not visible to the script, adding the card name to the reference can help..

Code: Select all

put field "txt_id" of card "Home" into sample["sample2"]
LiveCode Development & Training : http://splash21.com

Post Reply