Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Is it possible to import a function from another file in FunC?

I would like to put some utility functions into different files and call them from the main contract file. How can I do that?


This question was imported from Telegram Chat: https://t.me/tondev/117903

  
  
Posted 10 months ago
Votes Newest

Answers


Yes, you can do that.

Besides using the include statement, you can also add the files to the project.yml in the source section.

**However, make sure that the functions do not overlap as there is no function overloading in FunC. **

You can simply put the file in the same folder and use the #include "imports/stdlib.fc"; command.

For more examples, please refer to the Smart Contract Examples section in the TON documentation at https://docs.ton.org/develop/smart-contracts/#smart-contract-examples.

  
  
wiki
Posted 10 months ago
Howard Peng
10 × 1 Administrator
4K Views
1 Answer
10 months ago
10 months ago
Tags