Sorry Guys,
been trying to sort this riddle for two days now and seem to be getting nowhere towards a solution, so need a fresh pair of eyes to tell me were I'm going wrong.
the two fields of interest in my table are LOGO (c,20) and LOGO_FILE (Image Reference File), where LOGO contains file name for LOGO_FILE.
The code to refresh a Single Record (as below) works fine each time:
The code for currently highlighted Records only updates the LOGO_FILE field for the LAST record in the selection !!!
The Code to refresh All Records goes into some sort of loop and I cant get out of it without cancelling A5.
so where am I going wrong?
I should add that the test table I am using has 16 records, all with a correct value in the LOGO field.
been trying to sort this riddle for two days now and seem to be getting nowhere towards a solution, so need a fresh pair of eyes to tell me were I'm going wrong.
the two fields of interest in my table are LOGO (c,20) and LOGO_FILE (Image Reference File), where LOGO contains file name for LOGO_FILE.
The code to refresh a Single Record (as below) works fine each time:
t = table.current()
if ut(t.logo) <> "" then
img = "d:\my databases\bitmaps\logo"+chr(92)+ut(t.logo)+".bmp"
t.change_begin(.t.)
t.logo_file = image_filename_encode(img)
t.change_end(.t.)
end if
if ut(t.logo) <> "" then
img = "d:\my databases\bitmaps\logo"+chr(92)+ut(t.logo)+".bmp"
t.change_begin(.t.)
t.logo_file = image_filename_encode(img)
t.change_end(.t.)
end if
t = table.current()
ip = t.index_primary_get()
index_name = ip.name_get()
query.order = "recno()"
query.filter = current_highlighted_records()
query.options = "I"
qry = t.query_create()
t.fetch_first()
while .not. t.fetch_eof()
if ut(t.logo) <> "" then
img = "d:\my databases\bitmaps\logo"+chr(92)+ut(t.logo)+".bmp"
t.change_begin(.t.)
t.logo_file = image_filename_encode(img)
t.change_end(.t.)
end if
t.fetch_next()
end while
qry.drop()
t.index_primary_put(index_name)
topparent.refresh_layout()
ip = t.index_primary_get()
index_name = ip.name_get()
query.order = "recno()"
query.filter = current_highlighted_records()
query.options = "I"
qry = t.query_create()
t.fetch_first()
while .not. t.fetch_eof()
if ut(t.logo) <> "" then
img = "d:\my databases\bitmaps\logo"+chr(92)+ut(t.logo)+".bmp"
t.change_begin(.t.)
t.logo_file = image_filename_encode(img)
t.change_end(.t.)
end if
t.fetch_next()
end while
qry.drop()
t.index_primary_put(index_name)
topparent.refresh_layout()
path = "d:\my databases\bitmaps\logo"+chr(92)
t = table.current()
query.filter = "isnotblank(\"logo\")"
query.order = "recno()"
qry = t.query_create()
t.fetch_first()
WHILE .not. t.fetch_eof()
img = path+ut(t.logo)+".bmp"
t.change_begin(.t.)
t.logo_file = image_filename_encode(img)
t.change_end(.t.)
t.fetch_next()
END WHILE
qry.drop()
topparent.refresh_layout()
t = table.current()
query.filter = "isnotblank(\"logo\")"
query.order = "recno()"
qry = t.query_create()
t.fetch_first()
WHILE .not. t.fetch_eof()
img = path+ut(t.logo)+".bmp"
t.change_begin(.t.)
t.logo_file = image_filename_encode(img)
t.change_end(.t.)
t.fetch_next()
END WHILE
qry.drop()
topparent.refresh_layout()
I should add that the test table I am using has 16 records, all with a correct value in the LOGO field.
Comment