Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 06 FEB 1998 01:55:46PM bmc wrote:

Having problems with my anchor settings gettting wiped out on MDIFRAME. Everytime I set them, then save and run, the settings

will stay until I change something on that frame and a new save takes

place. Next time I go into frame designer the settings are lost.

I have search the online disc. for this topic and found 1 other entry but no answer. Is there a patch?


At 06 FEB 1998 05:12PM Cameron Revelation wrote:

bmc,

Having problems with my anchor settings gettting wiped out on MDIFRAME. Everytime I set them, then save and run, the settings will stay until I change something on that frame and a new save takes place. Next time I go into frame designer the settings are lost.

I believe this is a bug related to the use of style sheets. Remove the style sheet from the frame.

Cameron Purdy

info@revelation.com


At 09 FEB 1998 01:18PM Ron Hollar wrote:

Cameron,

How do you remove a style sheet from a form once it is created? Or do you mean to create it from scratch without specifying a style sheet?


At 09 FEB 1998 02:51PM Cameron Revelation wrote:

Ron,

How do you remove a style sheet from a form once it is created? Or do you mean to create it from scratch without specifying a style sheet?

Carefully. I wrote the following code once to help a customer do it without editing the form, but I could never post code this ugly:

<code>
function RemoveStyleSheet(winname)
if assigned(winname) else return "error: name required"
if len(winname) else return "error: name required"
open "SYSREPOSWINS" to f else return "error: opening SYSREPOSWINS"
key=@appid: "**": winname
read rec from f, key else return "error: no form ": winname
header=field(rec, @rm, 1, 1)
stylesheet=header
if len(stylesheet) else return "error: no style sheet attached"
header="
rec=fieldstore(rec, @rm, 1, 1, header)
write rec to f, key else return "error: writing form"
return "successfully removed style sheet ": stylesheet: " from ": winname

</code>

So I suggest you use something more like:

<code>
function RemoveStyleSheet(WinName)

declare function   Repository, Get_Status, EntID
declare subroutine Repository, Set_Status

$insert Logical

* check parameter
if assigned(WinName) else WinName="
if len(WinName) else
  return "Syntax:  run RemoveStyleSheet ''"
end

* init
Ret="
Key=EntID(@appid, "OIWIN", "", WinName)

* lock form
Set_Status(FALSE$)
Repository("LOCK", Key)
if Get_Status(Err) then
  Ret=Error (": Err: ") locking entity ": quote(Key)
end else
 * read form
  Rec=Repository("ACCESS", Key)
  if Get_Status(Err) then
    Ret=Error (": Err: ") reading entity ": quote(Key)
  end else
   * check for style sheet
    Header=field(Rec, @rm, 1)
    Style =Header
    if len(Style) then
      Header="
      Rec=fieldstore(Rec, @rm, 1, 1, Header)
      Repository("UPDATE", Key, Rec)
      if Get_Status(Err) then
        Ret=Error (": Err: ") writing entity ": quote(Key)
      end else
        Ret=Style sheet ": quote(Style): " removed from entity ": quote(Key)
      end
    end else
      Ret=No style sheet for entity ": quote(Key)
    end
  end

 * unlock form (since we locked it)
  Repository("UNLOCK", Key)
end

return Ret

</code>

Keep that code handy … you can re-use it to easily make utilities that modify a form programmatically in other ways. See the insert OIWin_Equates for more details on the SYSREPOSWINS structure. Also, Andrew McCauley did a Revmedia tech bulletin on the structure of either SYSREPOSWINS or SYSREPOSWINEXES records.

Cameron Purdy

info@revelation.com


At 10 FEB 1998 01:59PM Ron Hollar wrote:

Cameron,

Good code snippet! Thanks for the in depth answer.

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/65be74f68c91540c852565a30067fbcf.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1