-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 8/19/2016 3:34 PM, Nathan Smith wrote:
> hi guys So I finally managed to upgrade the server a bit, to a
> slightly more modern gamma moo. I also now have file i/o, but am
> puzzling the best way to do the following: someone submits an idea
> on the moo, it writes it to ideas.txt when an admin views it, it
> then gets the content of the file, reads it and presents the admin
> with a list of titles. the admin chooses said title then reads it.
Any reason why you wouldn't just use a multidimensional list?
> I was then think they delete it with a different command. The
> writing to the file is easy. Something like the following:
> file=file_open("ideas.txt","a-tf"); for x in(idea)
> ile_writeline(file, x); endfor
>
> the reading not so sure on. Perhaps something like this?
> file=file_open("ideas.txt","r-tf"); what=file_readlines(file, 1,
> file_tell(file)); file_close(file); titles=ideas={}; for x
> in(what) if(index(x,"title")==1) titles={@titles, x}; else
> ideas={@ideas, x}; endif endfor
>
>
> then for delete... that is where I get stuck. How to read is easy,
> but then how to delete just the first? I'd really appreciate if you
> guys could point in me the right direction here, the fileio docks
> don't provide sample moo codes, which is what I tend to learn from,
> so do tell me if I'm beating around the wrong bush here or
> something. Much appreciated Nate
>
> -- You received this message because you are subscribed to the
> Google Groups "MOO Talk" group. To unsubscribe from this group and
> stop receiving emails from it, send an email to
>
MOO-talk+u...@googlegroups.com
> <mailto:
MOO-talk+u...@googlegroups.com>. To post to this
> <mailto:
MOO-...@googlegroups.com>. Visit this group at
- --
Take care,
Ty
Twitter: @sorressean
Web:
https://tysdomain.com
Pubkey:
https://tysdomain.com/files/pubkey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBAgAGBQJXt3BHAAoJEAdP60+BYxejeLgH/jJ1nb2foith7sd9FvaO/9uh
W8MIjNaMX6WGhWZ5hVw4qXcp2tu9yGeyqdmCLR98kiALZop9X4MjJXwHZqbmU2ur
WXkjPJF5mg4UgenuEcBWbXjybu2vKwYRNJODQ/bAFTYH616Ko6n4jVgjFzJoykFO
ULlqOpmzuUjpWPw/mDSqhnx6mCpWa2NEWxgX/GISyXUnocBi7jX3oFThWkkQ/jqh
eCqCz1zuwfb7o7dxJSZLQ5TOux1Gszjk+GeZ3py9MhR8NxXHT75sU37y7meMDrzr
4Xu4z5JhAHTF/pl337LBTsJS2x7r2S4JcB0dwO7eTp9DW2BK1XFzeAvXRXQnKyE=
=m+VB
-----END PGP SIGNATURE-----